.docx、.pptx 等的正确 MIME 类型是什么? [英] What is a correct MIME type for .docx, .pptx, etc.?
本文介绍了.docx、.pptx 等的正确 MIME 类型是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
对于较旧的 *.doc 文档,这就足够了:
For older *.doc documents, this was enough:
header("Content-Type: application/msword");
我应该为新的 .docx 文档使用什么 MIME 类型?另外,对于 pptx 和 xlsx 文档?
What MIME type should I use for new .docx documents? Also, for pptx and xlsx documents?
推荐答案
以下是适用于 HTTP 内容流的正确 Microsoft Office MIME 类型:
Here are the correct Microsoft Office MIME types for HTTP content streaming:
Extension MIME Type
.doc application/msword
.dot application/msword
.docx application/vnd.openxmlformats-officedocument.wordprocessingml.document
.dotx application/vnd.openxmlformats-officedocument.wordprocessingml.template
.docm application/vnd.ms-word.document.macroEnabled.12
.dotm application/vnd.ms-word.template.macroEnabled.12
.xls application/vnd.ms-excel
.xlt application/vnd.ms-excel
.xla application/vnd.ms-excel
.xlsx application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
.xltx application/vnd.openxmlformats-officedocument.spreadsheetml.template
.xlsm application/vnd.ms-excel.sheet.macroEnabled.12
.xltm application/vnd.ms-excel.template.macroEnabled.12
.xlam application/vnd.ms-excel.addin.macroEnabled.12
.xlsb application/vnd.ms-excel.sheet.binary.macroEnabled.12
.ppt application/vnd.ms-powerpoint
.pot application/vnd.ms-powerpoint
.pps application/vnd.ms-powerpoint
.ppa application/vnd.ms-powerpoint
.pptx application/vnd.openxmlformats-officedocument.presentationml.presentation
.potx application/vnd.openxmlformats-officedocument.presentationml.template
.ppsx application/vnd.openxmlformats-officedocument.presentationml.slideshow
.ppam application/vnd.ms-powerpoint.addin.macroEnabled.12
.pptm application/vnd.ms-powerpoint.presentation.macroEnabled.12
.potm application/vnd.ms-powerpoint.template.macroEnabled.12
.ppsm application/vnd.ms-powerpoint.slideshow.macroEnabled.12
.mdb application/vnd.ms-access
有关更多详细信息,请查看这篇 TechNet 文章 和这个 博文.
For further details check out this TechNet article and this blog post.
这篇关于.docx、.pptx 等的正确 MIME 类型是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文