Name: PHP MimeType Class
Version: 1.0 Date Released: 10/20/02
Description: This class allows a PHP script to determine the mime type a file based on the file extension. This class is handy for PHP versions without the benefit of other tools to determine the mime type. The class defaults to octet-stream so if the file type is not recognized the user is presented with a file download prompt.
NOTES: The mime types for this version are based on Apache 1.3.27 mime types may change or need to be added in the future, the mime types are stored in an array so that an awk or other script can automatically generate the code to make the array.
First an instance of the mimetype class must be created, then the getType method should be called with the filename. It will return the mime type, an example follows.
$mimetype = new mimetype(); print $mimetype->getType('acrobat.pdf');
Author: Jason Sheets <email@example.com>
License: This script is distributed under the BSD License, you are free to use, or modify it however you like. If you find this script useful please e-mail me.
Direct known subclassesMailAttachmentMIME