This class inspired by Chris Jean's work, here: http://chrisjean.com/2009/02/14/generating-mime-type-in-php-is-not-magic/
It does some MIME trickery, inspired by the need to to deal with Openoffice and MS Office 2007 file formats -- which are often mis-interpreted by mime-magic, fileinfo, and the *nix `file` command.
In Drupal 6, we also make use of file_get_mimetype. See: http://api.drupal.org/api/function/file_get_mimetype/6 ... however this only provides a uni-directional lookup (ext->mime). While I don't have a specific use case for a mime->extension lookup, I think it's good to have in here.
Drupal 7 will have better mime handlers. See: http://api.drupal.org/api/function/file_default_mimetype_mapping/7
Located in /MimeClass.inc (line 29)
function: getType description: An alias to get_mimetype, for backwards-compatibility with our old mimetype class.
function: get_extension
description: returns *one* valid file extension for a given $mime_type
function: get_mimetype
description: returns a mimetype associated with the file extension of $filename
Documentation generated on Thu, 14 Jul 2011 16:56:05 -0300 by phpDocumentor 1.4.3