aboutsummaryrefslogtreecommitdiff
path: root/download
diff options
context:
space:
mode:
Diffstat (limited to 'download')
-rw-r--r--download/index.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/download/index.php b/download/index.php
new file mode 100644
index 0000000..d49bf6a
--- /dev/null
+++ b/download/index.php
@@ -0,0 +1,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;