Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Background: For some reason, whenever a user tries to open an xslx (excel 2007) file from our intranet using MSIE, the file download dialog interprets it as a "zip" file.

Admittedly, xslx files really are zip files, but we don't want that behavior. Just open in Excel, please.

Question:

Firefox, OTOH, opens the files normally. Is it possible that the fault is my apache configs? or is this a client-browser-only issue?

share|improve this question
1  
what version of IE are you running? –  warren Oct 30 '09 at 4:53
add comment

3 Answers

up vote 4 down vote accepted

You can indeed fix this in Apache's configuration. Add the following lines (and ensure that mod_mime is enabled):

AddType application/vnd.ms-word.document.macroEnabled.12 .docm
AddType application/vnd.openxmlformats-officedocument.wordprocessingml.document docx
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 xltm
AddType application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx

This will ensure that Apache sends the appropriate MIME type to the client, and IE will understand that the files are Office documents and not zips.

share|improve this answer
    
This work, but why the hell does this happen just in IE? Is not a firefox issue since is just in IE... –  KeyneON Dec 9 '10 at 17:03
1  
Both Firefox and IE have algorithms that are used to determine the file type when it is not provided by the server (as in this case). The Firefox algorithm is able to recognise the files and the IE one is not - this is admittedly ironic considering that Office and IE are built by the same company, but not particularly surprising. –  Tony Meyer Dec 14 '10 at 23:26
1  
Nice answer. I had completely forgotten about this. The irony regarding Office & IE is indeed pretty rich... –  DaveParillo Dec 21 '10 at 22:04
add comment

I doubt it's an apache config issue. Internet Explorer has it's own MIME Type Detection algorithm. You can circumvent this behavior by right-clicking and selecting 'File -> Save As' or just use MS 2003 .doc format.

share|improve this answer
    
Yes but... this is odd. We can't tell end users "Click save as because the file is downloaded incorectly"... It's a IE issue that has a fix with apache config. –  KeyneON Dec 9 '10 at 17:05
    
Yeah, it is odd, & I had completely forgotten about mod_mime, so you can actually fix this on the server end. Go figure IE needs apache to tell it how to interpret an office document.... –  DaveParillo Dec 21 '10 at 22:03
add comment

if its an apache config issue then there is the file that contains the mapping of extensions to mime types that you can quickly examine to rule out this possibility.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.