zip mime 类型,何时选择哪一种

发布于 2024-10-07 05:12:07 字数 395 浏览 7 评论 0原文

到目前为止,对于 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

且行且努力 2024-10-14 05:12:07

向 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).

花心好男孩 2024-10-14 05:12:07

如何识别有效的 MIME 类型?

现在具体来说一下 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?

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-” prefix
  • application/x-zip-compressed - some non-standard convention, I'm not sure if there is any significant usage
  • application/x-zip - some non-standard convention, I'm not sure if there is any significant usage
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文