First commit
This commit is contained in:
commit
d299e73fa4
3 changed files with 186 additions and 0 deletions
20
htdocs/dl.php
Normal file
20
htdocs/dl.php
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
define("MAIN_DIR", __dir__."/..");
|
||||
|
||||
if (!empty($_GET["f"]) && is_file(MAIN_DIR."/content/".$_GET["f"]))
|
||||
{
|
||||
$filename = MAIN_DIR."/content/".$_GET["f"];
|
||||
header('Content-Description: File Transfer');
|
||||
header('Content-Type: application/octet-stream');
|
||||
header("Content-Disposition: attachment; filename=\"".$_GET["f"]."\"");
|
||||
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($filename));
|
||||
readfile($filename);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
die ("Fichier introuvable");
|
||||
?>
|
||||
Reference in a new issue