|
Inebriated Software |
Release 1.1, 5/30/2001
Author: Paul Southworth <software@inebria.com>
This is a function to look up a MIME type for a given file extension, implemented in PHP. It works by reading your mime.types file and building an array keyed on the file extension. The mime_lookup() function returns the MIME type. Or you can use the array to implement your own functions.
This function only tells you what is in your mime.types file. If your mime.types file doesn't know about a file extension, this mime_lookup() function won't go find it for you.
It is freely distributed under a BSD-style license, which you will find in the source. You can view the source if you like. Or you can download it (save it as "mime_lookup.php").
If this software is useful to you, please go make yourself an account on Freshmeat and rate this software here: http://freshmeat.net/projects/mime_lookup/
My phpftp web-based FTP client can make use of this library.
Here are some brief examples:
This software is unlikely to receive many further revisions or enhancements, but reports of serious bugs or problems parsing a mime.types file would be appreciated - please accompany your e-mail with a copy of your mime.types file.