简体   繁体   English

mime-type < - >文件扩展名映射的完整列表

[英]complete list of mime-type <-> file extension mapping

I can't find a complete list of mime-type mappings on the internet. 我无法在互联网上找到完整的mime类型映射列表。 I would like to have a list that refers a file extension to every existing mime type. 我想有一个列表,将文件扩展名引用到每个现有的mime类型。

The list of all mime-types can be found here: 所有mime类型的列表都可以在这里找到:
http://www.iana.org/assignments/media-types http://www.iana.org/assignments/media-types

but that resource doesn't include the file extension mapping. 但该资源不包括文件扩展名映射。

I googled a while and couldn't find a mapping list with all mime-types. 我google了一段时间,无法找到所有mime类型的映射列表。 Only lists with most common ones. 只有最常见的列表。 In all lists I found for example this entry is missing: 在我发现的所有列表中,例如缺少此条目:

application/vnd.openxmlformats-officedocument.wordprocessingml.document   ->  .docx

Does someone know a resource where to find a complete mapping? 有人知道资源在哪里可以找到完整的映射吗?

使用Jürgen的mime.types链接和一些命令行魔术,您可以非常快速地生成所需的列表:

wget -qO- http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types | egrep -v ^# | awk '{ for (i=2; i<=NF; i++) {print $i" "$1}}' | sort

You have to install apache or nginx or something else and look at the mime.types file. 你必须安装apache或nginx或其他东西,然后查看mime.types文件。

# MIME type                 Extensions
# application/3gpp-ims+xml
# application/activemessage
application/andrew-inset            ez
# application/applefile
application/applixware              aw
application/atom+xml                atom
application/atomcat+xml             atomcat
# application/atomicmail
application/atomsvc+xml             atomsvc
# application/auth-policy+xml
...
more, more, more over 1300 mine-types.

I just want to let you know, there is a new class for this in framework 4.5 我只是想让你知道,在框架4.5中有一个新类

System.Web.MimeMapping.GetMimeMapping(filename);

source: https://msdn.microsoft.com/en-us/library/system.web.mimemapping(v=vs.110).aspx 来源: https//msdn.microsoft.com/en-us/library/system.web.mimemapping(v=vs.110).aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM