1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 | if (isset($_GET['file_id']) && is_numeric($_GET['file_id'])) {
// row is database result
$basename = $row['filename'] . "." . $row['fileext'];
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
header("Content-type: application/force-download");
header("Content-length: {$row['filesize']}");
header("Content-disposition: $attachment; filename=$basename");
$fhandle = fopen($file, "rb");
fpassthru($fhandle);
exit;
} else {
die("ko");
}
|