MIME Type

本文提供了Microsoft Office 2007及以上版本的所有官方MIME类型列表。为了支持新的OpenXML格式,建议Web服务器管理员更新其Web服务器元数据库设置,以确保正确地添加MIME类型头部到直接保存在服务器上并发送回的文档中。
What are the Microsoft Office MIME Types?
FILExt does not presently have a search capability for MIME types however, in the interest of helping, this FAQ contains a complete list of the official Microsoft Office MIME types for the newest version of Microsoft Office (2007+).

To fully support the new types, web server administrators should add the MIME types for the Open XML formats to their Web server metabase settings so as to add the correct MIME type header in documents saved directly on the server and sent back.

The following table documents the HTTP MIME types that are available when working with Office 2007 documents:

Ext
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
### mimeType 的定义与用途 mimeType 是一种标准,用来表示文档、文件或字节流的性质和格式。它通常由两部分组成:`type` 和 `subtype`,中间通过斜杠分隔,例如 `text/html` 或者 `image/jpeg`。这种结构允许系统识别数据的具体类型及其子类别。 #### 定义 mimeType 被称为媒体类型(Media Type),最初是在 MIME 协议中引入的一种机制[^1]。它的主要作用是用来描述网络上传输的数据类型以及如何处理这些数据。具体来说,mimeType 可以帮助浏览器或其他应用程序决定如何解析接收到的内容并呈现给用户。 #### 用途 mimeType 广泛应用于多种场景之中: 1. **HTTP 请求响应** 在 HTTP 中,服务器会向客户端返回一个 Content-Type 头部字段来声明资源的 mime 类型。这使得客户端能够知道应该怎样解释所接收的信息。例如,在 HTML 页面加载过程中,如果遇到 JavaScript 文件,则其对应的 mimeType 应该设置为 `application/javascript`[^2]。 2. **电子邮件附件传输** 当发送带有附件的邮件时,每种类型的文件都会被赋予相应的 mimeType 值以便收件方可以正确打开它们。比如 PDF 文档会被标记成 `application/pdf` 形式传递过去[^3]。 3. **移动应用开发环境下的多媒体支持** 对于 Android 开发而言,了解各种常见的 mimeType 尤其重要因为涉及到不同种类媒体播放器插件的选择等问题上都需要依赖于此信息来进行配置操作。 ```python import mimetypes def get_mime_type(file_path): return mimetypes.guess_type(file_path)[0] file = 'example.pdf' mime_type = get_mime_type(file) print(f"The MIME type of {file} is {mime_type}.") ``` 上述 Python 示例展示了如何利用内置库 `mimetypes` 来猜测某个本地路径对应文件可能具有的 mimeType
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值