1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
<?php
$file = $_GET['file'];
$file = stripslashes($file);
$tab = explode("\\",$file);
$nb_element_1 = count($tab) - 1;
$fichier = $tab[$nb_element_1];
header("Content-disposition: attachment; filename=\"".$fichier."\"");
header("Content-Type: application/force-download");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($file));
header("Pragma: no-cache");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0, public");
header("Expires: 0");
readfile("$file");
//JS ?
?> |