Closed (fixed)
Project:
Clieop Dutch Direct Payment
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
8 Apr 2008 at 15:55 UTC
Updated:
9 May 2008 at 09:01 UTC
When clicking on the download link the file is displayed in the browser and not downloaded.
This snippet should do
// required for IE, otherwise Content-disposition is ignored
if(ini_get('zlib.output_compression')) { ini_set('zlib.output_compression', 'Off'); }
// build file headers
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
// and some more headers
header("Content-Disposition: attachment; filename=\"".basename($filename)."\";" );
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($filename));
// refer to file and exit
readfile("$filename");
exit();
Comments
Comment #1
clemens.tolboomTested with FireFox and IE 6.0
Comment #2
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.