1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
if(isset($_GET['id'])) {
$reqDownload = "SELECT * FROM material WHERE etat = 1 AND id = ".$_GET['id'];
$resultDownload = mysql_query($reqDownload);
$rowDownload = mysql_fetch_assoc($resultDownload);
$file = 'upload/user_docs/'.$rowDownload['document'];
$size = filesize($file);
//header("Content-type: application/pdf");
header('Content-Type: application/force-download; name="' . basename($file) . '"');
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
header("Content-Transfer-Encoding: binary");
header("Content-Length: $size");
header('Pragma: no-cache');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header("Expires: 0");
readfile($file); |
Partager