diff options
Diffstat (limited to 'preview/index.php')
-rw-r--r-- | preview/index.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/preview/index.php b/preview/index.php new file mode 100644 index 0000000..f616ad5 --- /dev/null +++ b/preview/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["pvid"]) { + die(); +} + +$file = $_SERVER['DOCUMENT_ROOT'] . "/private/shares/" . $_SESSION['filename']; + +header('Content-Description: File Transfer'); +header('Content-Type: ' . mime_content_type($file)); +header('Content-Disposition: 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;
\ No newline at end of file |