Setting MIME Types in IIS
I am sure there is a simple answer to this one.
I have a docx file that I get an error when trying to download(document cannot be found).... .doc is fine .txt is also fine. I am sure this is just an iis setting, the permissions on the server are all the same for all files.
Yes, it's just an IIS setting: by default, it will only serve files for which the extension matches a defined MIME type.
To allow .docx files to be downloaded, follow the steps from the KB article linked above:
Note that the KB article uses the generic application/octet-stream MIME type: although that generally should work, if a more specific MIME type exists, such as application/msword, it's always best to use that.
In step 5 of the solution above you said
In the MIME Type box, type application/msword.
The "application/msword" MIME type is the type for the word 2003 ".doc" files. The correct MIME type for word 2007 ".docx" files is:
application/vnd.openxmlformats-officedocument.wordprocessingml.document
See this post.
Thanks this is very useful.
If you are interested MIME type for .pptx (Powerpoint 2007) is
application/vnd.openxmlformats-officedocument.presentationml.presentation
and .xlsx (Excel 2007) is
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
[These where transposed. I have corrected now, thanks for pointing it out Sven.]
链接地址: http://www.djcxy.com/p/53308.html上一篇: 如何定位标签周围的标签?
下一篇: 在IIS中设置MIME类型