List of ALL MimeTypes on the Planet, mapped to Fil

2019-01-13 00:30发布

Is there a resource that lists ALL the mimeTypes in existence?

I have found a few places with under 1000 mimeTypes, but then they still don't include common ones like .rar, .fla, .rb, .docx!

Does anyone have a COMPLETE list of mimetypes? Not down to the most obsure "company-only" ones, but at least all of the ones we might use.

Also, I'm looking for a list that maps file extensions to mimeTypes.

13条回答
戒情不戒烟
2楼-- · 2019-01-13 00:54
家丑人穷心不美
3楼-- · 2019-01-13 01:00

There's a good table in the classic book "HTTP: The Definitive Guide" by Gourley and Totty (O'Reilly, with a squirrel on the cover) in Appendix D. It appears to be complete and up-to-date as of the time the book was written (in 2002). That was a long time ago, but you'll find all the old favorites there as well as obscure "company-only" ones.

ISBN 1-56592-509-2, http://oreilly.com/catalog/9781565925090/

查看更多
成全新的幸福
4楼-- · 2019-01-13 01:00

User Paul Tarjan said in a comment:

There is a pretty good list on stdicon.com : stdicon.com/mimetypes

This website is no longer available, but the most recent archive is https://web.archive.org/web/20161015175648/http://www.stdicon.com/mimetypes

Note that this site doesn't mention "application/x-zip-compressed" (and it's not because of the escaping of slashes either) so it's not perfect.

查看更多
霸刀☆藐视天下
5楼-- · 2019-01-13 01:01

iana is tracking the official ones but of course folks can always declare their own...

In other words, it is doubtful you'll ever get the full list on the Planet.

Also consider the case of NPAPI plugins which declare MIME-types just to be be easily accessible... and these MIME-types might be not interesting to you for a reason or another.

查看更多
Anthone
6楼-- · 2019-01-13 01:03

My list (about 680 types) mimetype in xml here

查看更多
闹够了就滚
7楼-- · 2019-01-13 01:05

If your are using Java you could use Apache Tika, which is a powerful library for dealing with file types. With it you can easily get the preferred extension related to a mime type with a couple of rows:

TikaConfig config = TikaConfig.getDefaultConfig();
MimeType mimeType = config.getMimeRepository().forName("image/png"); //Generally your textual mime type
String extension = mimeType.getExtension();
// this would return the extension with the dot. For "image/png" returns ".png"

In this way you don't have to mess with downloading and parsing a file with the associations, I find it very comfortable. This is the way I've done the trick.

查看更多
登录 后发表回答