netflix2/php/simple_download.php
2020-11-08 15:14:32 +01:00

32 lines
647 B
PHP

<?php
include "function.php";
if (isset($_GET['file'])) {
$id = $_GET['file'];
$file = file_path($id);
if(is_file($file)) {
$type = mime_content_type($file);
header('Content-Description: File Transfer');
//header('Content-Type: application/octet-stream');
header('Content-Type: ' . $type);
header("Content-Disposition: attachment; filename=\"" . basename($file) . "\"");
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
readfile($file);
exit;
}
}
?>