IE8 Downloading docx Files As zip On Apache

23rd January 2012 - 2 minutes read time

I recently built a Drupal site on an Apache server setup and everything seemed fine until someone running IE8 tried to download a .docx file. For some reason IE8 insisted that this file was a .zip file and would open it as such, causing a bit of confusion as to what the problem was. I assumed that this was due to the mime type of the file not being set properly, but I decided to do a quick search to see if I could find anything to corroborate this. I thought it might be something odd that IE8 was doing as everything else was downloading the file perfectly.

After wading through multiple support forums and finding very little of any help I eventually gave up and went with my first hunch and set the mime type for the .docx file extension in the sites .htaccess file. Here is the rule I used:

AddType application/vnd.openxmlformats-officedocument.wordprocessingml.document docx

This solved the problem right away. To cover my bases for any future idiocy from IE8 I thought it might be good to set up some other mime types for Microsoft Office files. Here is the final list:

  1. AddType application/ .docm
  2. AddType application/vnd.openxmlformats-officedocument.wordprocessingml.document docx
  3. AddType application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx
  4. AddType application/ potm
  5. AddType application/vnd.openxmlformats-officedocument.presentationml.template potx
  6. AddType application/ ppam
  7. AddType application/ ppsm
  8. AddType application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx
  9. AddType application/ pptm
  10. AddType application/vnd.openxmlformats-officedocument.presentationml.presentation pptx
  11. AddType application/ xlam
  12. AddType application/ xlsb
  13. AddType application/ xlsm
  14. AddType application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx
  15. AddType application/ xltm
  16. AddType application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx

Just drop this into your .htaccess file or your mime.types file to get IE8 to correctly download the files.


Thank you, thank you, thank you! I was going through the same situation with all the other websites proving no help to sort the issue, they just wanted you to update browsers - which doesn't help web developers at all.

Gstar (Thu, 08/02/2012 - 04:30)

As you may already know, putting a list of all MS Office types is a bear. Thanks for doing all the heavy lifting.

Claude (Tue, 12/18/2012 - 16:22)

Thank you :-) Worked like a charm!

Marie (Fri, 05/24/2013 - 07:32)

Add new comment

The content of this field is kept private and will not be shown publicly.