Vincent Mayfield

Chief Executive Officer

Posted on July 22, 2009

Office 2007 Mime Types for IIS6

Today I had a customer that was complaining that they could not download a file that they had uploaded to the web server via an application that we wrote. Naturally I checked and verified that the user in question  did in fact upload the file to the server and made sure it was not corrupt. The file was there. However, I discovered that the file was an Office 2007 Word Document file. With Office 2007 Microsoft introduced a new set of file formats for Office. They now have four letter extensions such as docx, pptx, and xlsx.  The web server this customer has is running Windows Server 2003 with IIS6. The reason the web server cannot serve up the file is that it does not have a Mime Type for a .docx file.  Mime Types are how a web server knows how to serve up a file of a particular type and what application should open when served through the browser.  So they have to be added to IIS6.

There are a number of Mime Types for Office 2007. Here is a definitive list:

.docm,application/vnd.ms-word.document.macroEnabled.12
.docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document
.dotm,application/vnd.ms-word.template.macroEnabled.12
.dotx,application/vnd.openxmlformats-officedocument.wordprocessingml.template
.potm,application/vnd.ms-powerpoint.template.macroEnabled.12
.potx,application/vnd.openxmlformats-officedocument.presentationml.template
.ppam,application/vnd.ms-powerpoint.addin.macroEnabled.12
.ppsm,application/vnd.ms-powerpoint.slideshow.macroEnabled.12
.ppsx,application/vnd.openxmlformats-officedocument.presentationml.slideshow
.pptm,application/vnd.ms-powerpoint.presentation.macroEnabled.12
.pptx,application/vnd.openxmlformats-officedocument.presentationml.presentation
.xlam,application/vnd.ms-excel.addin.macroEnabled.12
.xlsb,application/vnd.ms-excel.sheet.binary.macroEnabled.12
.xlsm,application/vnd.ms-excel.sheet.macroEnabled.12
.xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
.xltm,application/vnd.ms-excel.template.macroEnabled.12
.xltx,application/vnd.openxmlformats-officedocument.spreadsheetml.template

To add all the mime-types to IIS:

  1. Stop IIS
  2. Edit the metabase XML file (C:\WINDOWS\system32\inetsrv\MetaBase.xml) using a text editor. 
  3. Search for the

 


1: <IIsMimeMap Location="/LM/MimeMap" />

element and append the lines above to the MimeMap attribute

You can also add them one at a time via the IIS UI.

Comments
Blog post currently doesn't have any comments.

Want to join the conversation?  Leave a comment using the form below!



 Security code