I recently worked on a project for my employer, Insource Technology, to develop a corporate blog. As the project progressed we ran into an interesting problem. An author would upload a .docx file to the site without an issue. When the file was downloaded it would not download as a .docx file but as a .zip file. When the .zip file was extracted the contents showed the XML structure of the .docx file but the file was not readable by Microsoft Word.
Background
Microsoft’s XML Document Format
With the release of Office 2007, Microsoft released a new file format based on XML. Microsoft dubbed this new file format Open XML and claimed many tangible advantages including smaller file size, improved privacy control and better integration. A full list of extensions and more in-depth information on the Open XML format can be found here
MIME File Types
Multipurpose Internet Mail Extensions (MIME) is an internet standard designed to identify the type of media content served by a web browser. The MIME types are used to help web browsers understand how to handle file types presented by a web browser or email application. Some of these MIME file types are set up by default to be interpreted correctly by the server. On some servers the .docx filetype is not set up by default.
Solution
Serving Office 2007 documents from an Apache Web Server
If you are running a blog on an apache web server you will need to add the following code to a .htaccess file in the root directory of your blog site. If you already have a .htaccess file you can add this to that file. No restart of the apache server is required.
application/vnd.openxmlformats-officedocument.wordprocessingml.document docx
application/vnd.ms-word.document.macroEnabled.12 docm
application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx
application/vnd.ms-word.template.macroEnabled.12 dotm
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx
application/vnd.ms-excel.sheet.macroEnabled.12 xlsm
application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx
application/vnd.ms-excel.template.macroEnabled.12 xltm
application/vnd.ms-excel.sheet.binary.macroEnabled.12 xlsb
application/vnd.ms-excel.addin.macroEnabled.12 xlam
application/vnd.openxmlformats-officedocument.presentationml.presentation pptx
application/vnd.ms-powerpoint.presentation.macroEnabled.12 pptm
application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx
application/vnd.ms-powerpoint.slideshow.macroEnabled.12 ppsm
application/vnd.openxmlformats-officedocument.presentationml.template potx
application/vnd.ms-powerpoint.template.macroEnabled.12 potm
application/vnd.ms-powerpoint.addin.macroEnabled.12 ppam
application/vnd.openxmlformats-officedocument.presentationml.slide sldx
application/vnd.ms-powerpoint.slide.macroEnabled.12 sldm
application/vnd.ms-officetheme thmx
application/onenote onetoc
application/onenote onetoc2
application/onenote onetmp
application/onenote onepkg
Serving Office 2007 document from and IIS Web Server
It is not necessary to add the MIME file types to versions of IIS 7.0 or greater. Microsoft’s Technet has a full article outlining the process to Register the 2007 Office system file format MIME types on servers. This article includes how to add the MIME file types to IIS 6.x web servers.

