I have an script that receives an encrypted url and from that generates a download, the most critic par of the script is this:
$MimeType = new MimeType(); $mimetype = $MimeType->getType($filename); $basename = basename($filename); header('Content-type: $mimetype'); header('Content-Disposition: attachment; filename=\'$basename\''); header('Content-Length: '. filesize($filename)); if ( @readfile($filename)===false ) { header('HTTP/1.0 500 Internal Server Error'); loadErrorPage('500'); }
Downloads works as charm in any Browser except IE, I have seen problems related to ‘no-cache’ headers but I don’t send anything like that, they talk about utf-8 characters, but there is not any utf-8 characters(and the $filename has not any utf-8 characteres neither).
This site has a problem similar to yours in IE6. To summarize:
I realize the code snippet you posted does not include a call to
session_start();, but I figured I’d share this possible solution in case you do have a call to it and just didn’t show us.