MIME type lookup PHP function reads your system mime.types file. You give it a file extension, and it tells you the MIME type (if found).