<p>I have an script that receives an encrypted url and from that generates a download, the most critic par of the script is this:</p>

<pre><code>$MimeType = new MimeType();
$mimetype = $MimeType-&gt;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');
}
</code></pre>

<p>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 <code>utf-8 characters</code>(and the $filename has not any utf-8 characteres neither).</p>

This site
has a problem similar to yours in IE6. To summarize:
session_start() by default sends a cache control header including "no-store".
  Internet Explorer takes this a bit too literally, but doesn't have appropriate
  error handling for the case, and as a result explodes cryptically when you
  attempt to save the output page to disk.
Before session_start(), add "session_cache_limiter('none');", or look up that
  function and tweak the limiter as appropriate (probably 'private' is closer to
  the mark).
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.