Microsoft Office 2007 MIME Types with Apache and IIS

Apache , IIS , Misc , MS Office , Server and Hosting Add comments

I was working with a 3rd Party file service \ handling provider and came across an issue whereby when I uploaded a Microsoft Office 2007+ document the "detected MIME type" was being returned as "application/zip".

Turns out there's an easy enough fix for this for their servers.  Simply update the web server to include the new \ incorrect MIME types.  


There are two methods you can use to manage this with Apache, mime.types file or in the httpd.conf file.


In the file "C:\Program Files\Apache Software Foundation\Apache2.2\conf\mime.types" you can declare your MIME types by simply following the same convention as used in the existing file.

If the file doesn't exist here, look for the section named <IfModule mime_module> in your httpd.conf file which includes the key value pair setting "TypesConfig conf/mime.types".  This is the path to your mime.types file.

httpd.conf - AddType

The AddType directive allows you to add to or override the MIME configuration file types specified in TypesConfig module.

Simply copy the AddType commands below into the <IfModule mime_module> section of the httpd.conf file.

There should already be some examples of this commented out using the '#' symbol at the start of the string.

AddType application/ .docm
AddType application/vnd.openxmlformats-officedocument.wordprocessingml.document docx
AddType application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx
AddType application/ potm
AddType application/vnd.openxmlformats-officedocument.presentationml.template potx
AddType application/ ppam
AddType application/ ppsm
AddType application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx
AddType application/ pptm
AddType application/vnd.openxmlformats-officedocument.presentationml.presentation pptx
AddType application/ xlam
AddType application/ xlsb
AddType application/ xlsm
AddType application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx
AddType application/ xltm
AddType application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx



Not to be discriminatory but for anyone using IIS please see the following posts for details on how to manage this:


Bookmark and Share

5 responses to “Microsoft Office 2007 MIME Types with Apache and IIS”

  1. Simon Whatley Says:
    You could also be website-specific and include the mime-type declarations in your .htaccess file.

    I suppose you could then lock-down each application by defaulting Apache to not accepting any mime-type, except those declared in .htaccess.
  2. Niall O'Doherty Says:
    Great tip Simon.

    Never really thought about locking down the MIME types on a per-application basis!!
    I like the idea of that though.
  3. Convert Word Document To PDF Says:
    Good posting, I've just stumbled up on this website researching Google for Microsoft office help. I wonder if anyone may help me with a little problem? I'm trying to figure away how to display a current word count yet it is not showing up, I am using 2007.
  4. Niall O'Doherty Says:
    If I understand your questions correctly, you're using Office 2007 and want to get the word count of a document?

    If so the link below should help:

  5. Vipin Kohli Says:
    many many thanks.. you solved my problem.. thank you very much....

Leave a Reply

Leave this field empty:

Powered by Mango Blog. Design and Icons by N.Design Studio