excel - .docx、.pptx 等的正确 MIME 类型是什么?

标签 excel ms-word ms-office powerpoint mime-types

对于较旧的 *.doc 文档,这已经足够了:

header("Content-Type: application/msword");

新的 .docx 文档应使用什么 MIME 类型?另外,对于 pptx 和 xlsx 文档?

最佳答案

以下是 HTTP 内容流的正确 Microsoft Office MIME 类型:

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 article还有这个blog post .

关于excel - .docx、.pptx 等的正确 MIME 类型是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4212861/

相关文章:

hyperlink - 查询字符串已从超链接 URL 中删除(互操作)

iis - 为什么 PPTX 从网站下载为 ZIP 文件?

vba - 在 excel vba 上处理错误

excel - 在 Active Directory 中搜索锁定的帐户 (Excel/VBA)

c# - 使用 C# 从现有模板创建 Word 文档

vba - 使用 VBA 在 Word 中设置嵌套字段

html - displayDialogAsync 和 html5-history-api 的冲突

windows - 将 Unix/Linux 时间转换为 Windows 时间的方法

vba - 用于排序的 Excel 常量

c++ - const char* 没有被 C++ 正确解释为 Excel 库