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.