Can't download file in IE7 but there isn't any problem in Firefox, Chrome, etc..?

Posted by levhita on Stack Overflow See other posts from Stack Overflow or by levhita
Published on 2008-09-22T20:23:07Z Indexed on 2010/03/29 4:43 UTC
Read the original article Hit count: 205

Filed under:
|
|

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).

© Stack Overflow or respective owner

Related posts about php

Related posts about ie7