Which MIME type is correct for the .exe file?

微笑、不失礼 提交于 2019-12-23 06:48:06

问题


I try to find which MIME type corresponds to the each extension and I get ambigous results.

According to webdesign.about.com the correct MIME for exe is: application/octet-stream

According to freeformatter.com the correct MIME for exe is: application/x-msdownload and it says that application/octet-stream is MIME for bin extension.

According to iana.org the correct MIME for exe (or sth called vnd.microsoft.portable-executable as I don't see exe there) is: application/vnd.microsoft.portable-executable

Which website is the most accurate cause I don't know what kind of content type value I should expect on the server site in the HTTP header.


回答1:


application/vnd.microsoft.portable-executable is a registered MIME type and its description matches what you want to use it for.

The x- prefix in application/x-msdownload indicates that it is experimental so it should generally be avoided: Especially if something standard is available as it in in this case.

application/octet-stream is for arbitary collections of bytes. It does match an executable file, but it isn't as specific as application/vnd.microsoft.portable-executable.

Use application/vnd.microsoft.portable-executable.



来源:https://stackoverflow.com/questions/41459168/which-mime-type-is-correct-for-the-exe-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!