mime.types

Lucas Gonze lgonze at panix.com
Fri Jan 9 11:37:15 PST 2004


I'm in the process of writing a module to guess the mime type of a URL.  
  To do this I need a list mapping extensions to mime types.  Writing  
that myself that would be dumb, so I surfed around, but I didn't find  
anything really good.  The IANA registry is terrible, completely out of  
date, and even if it weren't it is not formatted in a way amenable to  
generating a map.

I found a pretty good mime.types file at my ISP, though it lacks a  
number of mime types that matter.  The best code I found was:
http://search.cpan.org/~okamoto/MIME-Types-0.06/Types.pm

I also found a good algorithm at:
http://msdn.microsoft.com/workshop/networking/moniker/overview/ 
appendix_a.asp

However the mime.types from my ISP is still very incomplete; it doesn't  
have .m3u or .ram, for example, and it also lacks the metadata needed  
by Types.pm.

So, well, this is a stupid situation.  Obviously what I have to do is  
manually add missing extensions as I find them.  But this should really  
be a standardized list maintained by a group.  Does that exist already?

An alternative to a manually generated map is to use crawler results to  
auto-generate one, perhaps with human editing of the results.

Thoughts?





More information about the FoRK mailing list