I'm getting desperate. I've tried an amazing combination of header commands to get IE8 to prompt a file dialog box for a known or unknown MIME type.
I've spent a lot of time researching this and I still can't get anything that IE8 likes without hanging. My code works fine in Google Chrome, Mozilla and Firefox...
Does anyone know how to get this to work in IE8?
I've tried this:
Code: Select all
header("Content-Type: application/pdf");
header("Content-Length: ".(string)($filesize));
header("Content-Disposition: attachment; filename=\"".$filename."\";");
Code: Select all
header("Pragma: public");
header("Expires: ".gmdate("D, d M Y H:i:s", mktime(date("H")+4, date("i"), date("s"), date("m"), date("d"), date("Y")))." GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Content-Type: application/pdf");
header("Content-Length: ".(string)($filesize));
header("Content-Description: File Transfer");
header("Accept-Ranges: bytes");
header("Content-Disposition: attachment; filename=\"".$filename."\";");
header("Content-Transfer-Encoding: binary\n");
Thanks in advance!
Eric
EDIT: I've found a MS note about IE7 and IE8 having a new "X-Download-Options: noopen" for security. However I've tried their exact syntax for Force Download and it doesn't work either.
http://blogs.msdn.com/ie/archive/2008/0 ... ction.aspx