Skip to content

Download Office 2007 File Extensions/MIME Types with IIS 6.0

I encountered a strange error today while I was developing a document repository website in a Windows Server/IIS environment.  When I pointed my browser at myfile.docx it returned a 404 error, but other files in the same directory were served correctly.  After some Googling, I discovered that Microsoft’s IIS only allows the download of files that are in a list of predefined types as a security measure. To be able to download Office 2007 files from IIS you need to add the extension/MIME type pairs to the IIS configuration.

There are 2 ways to achieve our goal of accessing Office 2007 files via the browser:

Add the Office File Extensions in IIS

  1. Open IIS
  2. Right-click on the website profile and select Properties from the menu
  3. Goto the HTTP Headers tab
  4. Click on the MIME Types button at the bottom of the dialog
  5. Click New
  6. Add the File Extensions and MIME Types you require from the list at the bottom of this post

or alternatively, you can

Edit the Metabase Configuration File

  1. Stop IIS
  2. Open C:/Windows/system32/inetsrv/metabase.xml
  3. Search for IIsMimeMap
  4. Add the list of MIME types below to the end of the list
  5. Restart IIS

Office 2007 Document MIME Types

.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

Source: therightstuff.de