When we try to download some Office documents with OpenXML format(Office 2007 or later), the document will be probably identified as an zip file as below.
If you try to save the file, the file extension could also be .zip instead of .docx.
This problem only happens on IE6,7,8. It’s fine with IE9 or other web browsers.
This problem is caused by the MIME Sniffing feature of IE. For more information about how IE sniffs MIME type, please refer to http://msdn.microsoft.com/en-us/library/ms775148(VS.85).aspx
If Internet Explorer knows the Content-Type specified and there is no Content-Disposition data, Internet Explorer performs a "MIME sniff," scanning the first 200 bytes of the file to determine if the file structure matches any known MIME types. For more information on MIME sniffing, see MIME Type Detection in Internet Explorer. If the MIME sniff detects a MIME type known to Internet Explorer, and the file has not been loaded by a mimefilter already, Internet Explorer sets that file name extension before placing the file in the local browser cache.
Actually, OpenXML is a zipped, XML-based file format developed by Microsoft.
This is why the .docx file is recognized as a .zip file.
If you capture a HTTP trace of this request, you will always get the below Content-Type
(Status-Line) HTTP/1.1 200 OK
Date Tue, 27 Mar 2012 05:10:22 GMT
There are two options to resolve the issue.
l Disable MIME Sniffing from server side
We only need to add the below custom HTTP header from web server
You can refer to http://technet.microsoft.com/en-us/library/cc753133(v=WS.10).aspx to learn how to add header on IIS7.
l Set the proper Content-Type for OpenXML documents
To do so, we need to add the correct MIME type on the web server side.
Please refer to http://technet.microsoft.com/en-us/library/cc725608(v=WS.10).aspx to learn how to add MIME type on IIS7. Here’s the list of the MIME types for Office documents.
ZhiXing Lv from APGC DSI Team