Corrupt Zip file when downloaded from Apache with Internet Explorer

apache-2.2compressiongzipinternet explorer

I have a zip file being served by Apache with mod_gzip compression turned on. Everything is fine when the file is downloaded with Firefox. When downloaded with IE7 the zip file is corrupt. Any suggestions? Do I need to change the mime type for zip files or perhaps exclude zip files from gzip compression?

Best Answer

What MIME type are you sending along with the .zip file? I have had errors similar with dynamic download pages (such as download.php sending a file) and compression. When using something like application-zip and Content-Encoding: gzip, IE would not uncompress the file. I corrected this by using a MIME type of application/octet-stream, if I recall correctly.

That being said, you should probably exclude .zip from gzip compression anyway, since it's probably useless if not actually hurting performance.