1 2 3 4 5 6 7 8 9 10 11 12 13 14
| public function downloadAction($file){
$this->disableRendering(true, true);
$filepath = APPLICATION_PATH.'/../public/depot/'.$file;
$filesize = filesize($filepath);
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachement; filename="' . $file . '"');
header('Content-Length: ' . $filesize);
header("Pragma: no-cache");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0, public");
header('Date: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
ob_clean();
flush();
readfile($filepath);
} |
Partager