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