SYNOPSIS

 use MIME::Types;
 my $mimetypes = MIME::Types->new(...);      # MIME::Types object
 my $type = $mimetypes->type('text/plain');  # MIME::Type  object
 my $type = $mimetypes->mimeTypeOf('gif');
 my $type = $mimetypes->mimeTypeOf('picture.jpg');

DESCRIPTION

MIME types are used in many applications (for instance as part of e-mail and HTTP traffic) to indicate the type of content which is transmitted.

Sometimes detailed knowledge about a mime-type is need, however this module only knows about the file-name extensions which relate to some filetype. It can also be used to produce the right format: types which are not registered at IANA need to use 'x-' prefixes.

This object administers a huge list of known mime-types, combined from various sources. For instance, it contains all IANA types and the knowledge of Apache. Probably the most complete table on the net!

MIME::Types and daemons (fork)

If your program uses fork (usually for a daemon), then you want to have the type table initialized before you start forking. So, first call

   my $mt = MIME::Types->new;

Later, each time you create this object (you may, of course, also reuse the object you create here) you will get access to the same global table of types.