Go to content

Go to employees

Go to search

Office 2007 files behaves as compressed folder

A solution for servers not able to handle Office 2007 files correctly

Lars Øyvind Bodahl
 

One of our customers had a problem with Office 2007 files opening as zip files in IE8. The files opened as expected for Firefox users. In addition, everything works fine in the test environment (including IE8).

If you are experiencing the same problems, you should try the following.

1)
Check the MIME-types. The correct MIME-types are:

".manifest", "application/manifest"
".xaml", "application/xaml+xml",
".application",  "application/x-ms-application",
".deploy", "application/octet-stream"
".xbap", "application/x-ms-xbap"

".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"

We checked the production server, and the MIME-types were correct. So, we moved on to the next step.

2)
After emailing EPiServer support back and forth, it turns out that this is a bug: "Bug #31155: Office xml files (docx, pptx, ..) are treated as .zip files when downloaded in IE"

There are two solutions to this problem:
1 - Install Office 2007 on the server
2 - Install  MS Office Compatibility Pack for Word, Excel and Powerpoint 2007 on the server.

We did not want Office on the server, so we went for the compatibility pack solution. You can download the compability pack here.

Windows Server 2008 is NOT listed as a supported operating system, so we were a bit skeptical to install it in a production environment. But, we got information that it was sucessfully installed on a Windows 2008 server, so we decided to try it out.

3)
We installed the compability pack on the server, and voila :-) The Office 2007 files opens without any problems in IE8, Firefox, Opera, etc

Thanks to EPiServer Support for helping us find a workaround to the bug.

Tags


Comments:

  1. Good Stuff Lars Øyvind. There are several others that are experiencing the same issue on other (non-episerver) sites. http://thesource.ofallevil.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.internetexplorer.security&tid=90720243-214c-44cf-a327-2cdf50275a90&cat=&lang=&cr=&sloc=&p=1

  2. In EPiServer CMS 4 when using virtual file systems (you've moved /upload away from your site root) the new office mimetypes are not available at all. You cannot add them using IIS either, they have to be added programatically. Bummer. /Steve

  3. One other alternative as Steve mentions is to add the MIME types programatically to the fallback MIME list that EPiServer uses. This way you don't have to install anything on the server. I call this method from the Application_Start event: private static void RegisterMimeTypes() { MimeMapping.AddMimeMapping(".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"); MimeMapping.AddMimeMapping(".xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); // etc. }

  4. More information at my blog: http://www.epinova.no/no/Blog/Jorgen-Helgheim/Dates/2008/11/Office-2007-Mime-Types-for-IIS/
Post a comment