aboutsummaryrefslogtreecommitdiff
path: root/download/index.php
blob: d49bf6a4715ba1b8e734035b96c9a733e3f61456 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php

session_start();

if ($_SERVER['SERVER_NAME'] !== "flsh.sytes.net") {
    header("Location: /");
    die();
}

if (isset($_GET['i'])) {
    $id = $_GET['i'];
} else {
    header("Location: https://share.familine.mooo.com");
    die();
}

if ($id !== $_SESSION["dlid"]) {
    die();
}

$file = $_SERVER['DOCUMENT_ROOT'] . "/private/shares/" . $_SESSION['filename'];

header('Content-Description: File Transfer');
header('Content-Type: ' . mime_content_type($file));
header('Content-Disposition: attachment; filename="' . str_replace("\"", "''", $_SESSION['name']) . '"');
header('Content-Transfer-Encoding: binary');
header('Content-Length: ' . filesize($file));
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
ob_clean();
flush();
readfile($file);
exit;