Tuesday 01 March 2011 6:35:42 am
Hi everyone, I have a probleme, I have a page which with a list of PDF document in my root, and I created a module. In fact I want to put header in this module to force download the PDF files but it's doesn't work :s Here my module (doc/download) : $module =& $Params['Module']; $path = "/opt/app/a353/apache-tst/htdocs/portantwerppdf/"; $file = "201102251800_Nota_Antwerpen.pdf"; if(!file_exists($path.$file)) { die('Error: File not found.'); } else { header('Pragma: public'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Cache-Control: private',false); header('Content-Type: application/pdf'); header('Content-Disposition: attachment; filename="'.$file.'"'); header('Content-Transfer-Encoding: binary'); header('Content-Length: '.filesize($path.$file)); readfile($path.$file); exit(); } o you have a solution o can you help me ? Thanks !
Foujino ~ http://www.foujino-blog.be
|