Can't load the file in IE7, but there is no problem in Firefox, Chrome, etc.?

I have a script that receives an encrypted URL and a load is generated from it, the most critical parameter to 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');
}

The downloads work like charm in any browser other than IE, I saw problems related to the "no-cache" headers, but I don't send anything, they talk about utf-8 characters, but there are none utf-8 characters(and $ filename doesn't have a single character utf-8).

+5
source share
3 answers

This site has a problem similar to yours in IE6. Summarizing:

session_start() , "no-store". Internet Explorer , , , , , .

session_start() session_cache_limiter ('none'); " , , (, 'private' ).

, , , session_start();, , , .

+3

,

header('Pragma: public');
header('Cache-Control: max-age=0');

, session_start() .

: : Internet Explorer FileName WebServer

+8

Use this

In the IE7 browser, go to the Internet option → security ---> custom level ---> download then the automatic request to download the file is turned on.

this will solve the problem.

hope this helps

0
source

All Articles