paul_venezia
Senior Contributing Editor

Forcing IE to behave

analysis
Apr 20, 20061 min

If you're looking to make IE respond like all the other browsers when it comes to forced downloads, standard Content-type and Content-disposition headers won't do the trick. However, this PHP snippet shows what will. Be sure to modify the last Content-type header to whatever MIME type the file actually is. header("Pragma: public"); // required header("Expires: 0"); header("Cache-Control: must-revalidate, post-ch

If you’re looking to make IE respond like all the other browsers when it comes to forced downloads, standard Content-type and Content-disposition headers won’t do the trick. However, this PHP snippet shows what will. Be sure to modify the last Content-type header to whatever MIME type the file actually is.

header("Pragma: public"); // required header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: private",false); header('Content-Description: File Transfer'); header('Content-Type: application/force-download'); header("Content-Type: application/download"); header("Content-Type: a-xzip-compressed"); header("Content-disposition: attachment; filename=" . $name);