File added to download specified file

This commit is contained in:
Matt Pass
2013-12-11 06:24:44 +00:00
parent bbd96d39ab
commit b692360fb0

14
lib/download.php Normal file
View File

@@ -0,0 +1,14 @@
<?php include("settings.php");?>
<?php
$file = $docRoot.$iceRoot.str_replace("|","/",$_GET['file']);
if (file_exists($file)) {
header('Content-Description: File Transfer');
header('Content-Disposition: attachment; filename='.basename($file));
header('Content-Length: '.filesize($file));
ob_clean();
flush();
readfile($file);
exit;
}
?>