Apache Mime Types for Office 2007 Files

Jon had posted up a link to an Excel file he created with the extension .xlsx, an Office 2007 file, on to his site. The upload was fine and all until you wanted to download it, in IE. He was telling me why the Excel file was saving to a zip document instead of the xlsx document. I wasn’t sure what he was talking about because I’m on a Mac and Macs don’t have IE. Good thing I have a virtual machine running with IE7 on it. I thought he was talking gibberish but what he said was true. It was saving the Excel as a zip. I opened the zip to find worksheets and style data so I guess this new Microsoft file type is pretty much a zip file so that probably made IE confused.

I went to look around for solutions for Apache mime type configurations for Office 2007 file extensions and found this solution and added it to his .htaccess file:

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

This solved the issue and Jon couldn’t be any happier.

Source: http://dogma.swiftspirit.co.za/archives/183

This entry was posted on Tuesday, March 24th, 2009 and is filed under Programming. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply