gpt4 book ai didi

php - 上传的 zip 文件的 Mime 类型是 application/octet

转载 作者:行者123 更新时间:2023-12-03 12:14:44 45 4
gpt4 key购买 nike

我有一个只允许 zip 文件的简单文件上传。在我的机器上(Windows 7、Firefox 19.0.2)它工作正常。在另一台机器(Windows 8、Firefox 19.0.2)上,当我上传相同的文件时,文件类型检查失败。

在 Windows 8 机器上,.zip 的 mime 类型是 application/octet。为什么?另外,我以前没有遇到过这种 mime 类型。我期待 application/octet-stream

application/octet 有什么用,为什么它在另一台机器上不同?

最佳答案

从未听说过 application/octet。猜测它只是等同于application/octet-stream。无论如何,这只是一个问题。

也许看看这个:http://msdn.microsoft.com/en-us/library/ms775147%28v=vs.85%29.aspx

The MIME types "text/plain" and "application/octet-stream" are termed ambiguous because they generally do not provide clear indications of which application or CLSID should be associated as the content handler...

...and defaulting to the final determined MIME type of "application/octet-stream." Other types of files, such as .reg files, behave similarly.

Finally, if no file name extension is found, or one is found with no associated MIME type or registered application, the MIME type "text/plain" is returned if the data scan indicated predominantly text, or "application/octet-stream" if the data scan indicated binary, because this is the furthest correct determination that could be made.

关于php - 上传的 zip 文件的 Mime 类型是 application/octet,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15368559/

45 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com