Windows and IE users have problems downloading corrupted files when using gzip or deflate

Do you upload zip files to your WordPress site? Your Windows and IE users may be downloading corrupted files.

This issue has been floating around for a while, but I only ran up against it a couple of weeks ago.  The short of it is that if you have Internet Explorer users complaining that they are unable to download usable zip files from your WordPress or otherwise LAMP website, this may be the fix you’re looking for.  I might also add that in my own testing of this, downloading zip files from one of my WordPress sites with gzip and deflate compression enabled were also corrupted in Firefox on a Windows 7 computer, so it’s not just constrained to IE7 and IE8 users.  However, the issue is indeed resolved on computers with IE9 installed.

Microsoft has posted the description of the bug in urlmon.dll in their “Internet Explorer May Lose the First 2,048 Bytes of Data That Are Sent Back from a Web Server That Uses HTTP Compression” article, but abhorrently they’ve also listed the fix as encouraging developers and/or users (think about your mom, now) to go in and modify the registry.  Now I love to help my parents with their email password reset or their wireless printing, but I don’t want to walk my mother through modifying the registry over the phone.  Since we care about our IE and Windows users even when their operating system or browser doesn’t, we can’t just leave them out on their own.

As WordPress developers, let’s help minimize Microsoft’s urlmon.dll problem, and fix it the right way by simply disabling gzip compression on our already-compressed files, if at least for our own sites!  You’ll need to modify your Apache configuration file, typically in either the more global httpd.conf file, or the deflate.conf mod file if you’re running an Ubuntu or Debian system by adding the following code:

# Disable compression of zip files because of Windows/IE bug.
# (see http://support.microsoft.com/default.aspx?scid=kb;[LN];Q312496)
SetEnvIfNoCase Request_URI \.(?:zip)$ no-gzip dont-vary

This line disables compression on all files with the *.zip extension for all browsers, which is ok because the files are compressed anyway.

Microsoft also references this in another support article “An error occurs after downloading a .ZIP file with Internet Explorer“, where you can find solutions for IIS 6 and 7 servers.

Tomorrow is the last day to vote for my topic, “Deploying WordPress: From Zero to Ninja“, for the 2012 SXSW Interactive Festival.

Please check out my panel proposal and give me a thumbs up, as well as leave me any questions, or comments!