First commit

This commit is contained in:
Némunaire 2012-02-27 17:59:03 +01:00
commit d299e73fa4
3 changed files with 186 additions and 0 deletions

20
htdocs/dl.php Normal file
View 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");
?>