- Code: Select all
<?PHP
$download_path = $_SERVER['DOCUMENT_ROOT'] . "/my_cms/root/scripts/logging_in/uploaded_files";
$filename = $_GET['filename'];
$file = "$download_path/$file";
if(!file_exists($file)) die("I'm sorry, the file doesn't seem to exist.");
$type = filetype($file);
$today = date("F j, Y, g:i a");
$time = time();
header('Content-Description: File Transfer');
header("Content-type: $type");
header("Content-Disposition: attachment;filename=$filename");
header("Content-Transfer-Encoding: binary");
header('Expires: 0');
readfile($file);
?>
What is the problem with it?
Thank you.

