Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
899 views
in Technique[技术] by (71.8m points)

http - complete list of mime-type <-> file extension mapping

I can't find a complete list of mime-type mappings on the internet. I would like to have a list that refers a file extension to every existing mime type.

The list of all mime-types can be found here:
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. 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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Using Jürgen's mime.types link and a little command line magic, you can generate the list you want very quickly:

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...