32 lines
647 B
PHP
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
?>
|