zip mime 类型,何时选择哪一种
到目前为止,对于 Zip 文件的 Mime 类型,我已经看到:
- application/octet-stream
- multipart/x-zip
- application/zip
- application/zip-compressed
- application/x-zip-compressed
我想我的问题是哪个是“最好的”,为什么?为什么有这么多选择?我使用 winrar,它似乎并不关心 Mimetype 是什么,但 WinZip 似乎只喜欢 multipart/x-zip 和 application/octet-stream。是否有一个 Mimetype 我可以下载所有 Zip 文件,因为它适用于所有程序?
谢谢!
So far for Mime Types for Zip files I've seen:
- application/octet-stream
- multipart/x-zip
- application/zip
- application/zip-compressed
- application/x-zip-compressed
I guess my question is which is the "best" and why? Why is there so many choices? I use winrar and it doesn't seem to care what the Mimetype is, but WinZip seems to only like multipart/x-zip and application/octet-stream. is there a Mimetype I can have all Zip files be downloaded as that will work in all programs?
thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
向 IANA 注册的 MIME 类型为 application/zip : http://www.iana.org /assignments/media-types/application/zip
WinZip 不是一个参考实现(因为最初的 ZIP 标准是由 PkWare 开发的)。
Registered with IANA MIME type is application/zip : http://www.iana.org/assignments/media-types/application/zip
WinZip is not a reference implementation (since originally ZIP standard is developed by PkWare).
如何识别有效的 MIME 类型?
媒体类型/子类型标识符
。示例:image/png
。x-
前缀 表明它是实验性的且非标准的(未向 IANA 注册)。现在具体来说一下 zip...
application/zip
是 zip 文件的标准 MIME 类型,已在 IANA 正式注册。这似乎是一个不错的第一选择:)application/octet-stream
是在 RFC 2045 和 2046:“octet-stream”子类型用于指示正文包含任意二进制数据,因此内容可以是任何内容,而不仅仅是 zip。multipart/x-zip
- 与“离散”类型不同,“multipart”类型 是一种表示由多个组成部分组成的文档的类型,每个组成部分都可能有其自己的 MIME 类型。我怀疑这里的逻辑是一个压缩文件由多个文件组成。因此,zip 符合“多部分”的定义。但对我来说,这看起来像是过度解释,我希望部分之间的纯文本分隔符将内容分类为多部分。此外,它还没有注册为标准。application/zip-compressed
- 非标准类型,命名 违反了 RFC2046:以字符“X-”开头的媒体类型值是私有值,由双方同意的同意系统使用。任何没有严格和公共定义的格式都必须以“X-”前缀命名application/x-zip-compressed
- 一些非标准约定,我不确定是否有是否有任何重要的用途application/x-zip
- 一些非标准约定,我不确定是否有任何重要的用途How to recognize a valid MIME type?
media-type/subtype-identifier
. Example:image/png
.x-
prefix of a subtype-identifier indicates that it is experimental and non-standard (not registered with IANA).Now about the zip specifically...
application/zip
is a standard MIME type for zip files, officially registered with IANA. It seems like a good first choice :)application/octet-stream
is defined in RFC 2045 and 2046: The “octet-stream” subtype is used to indicate that a body contains arbitrary binary data, so the content can be anything, not just zip.multipart/x-zip
- unlike a “discrete” type, the “multipart” type is one which represents a document that's comprised of multiple component parts, each of which may have its own individual MIME type. I suspect that the logic here is that a compressed file consists of multiple files. Thus, zip fits the “multipart” definition. But to me, it looks like overinterpretation, I would expect plain-text delimiters between parts to classify content as multipart. Moreover, it's not registered as a standard.application/zip-compressed
- a non-standard type, the naming violates RFC2046: A media type value beginning with the characters “X-” is a private value, to be used by consenting systems by mutual agreement. Any format without a rigorous and public definition must be named with an “X-” prefixapplication/x-zip-compressed
- some non-standard convention, I'm not sure if there is any significant usageapplication/x-zip
- some non-standard convention, I'm not sure if there is any significant usage