Sending most correct mimetype
- by Roland Franssen
Hi all,
I have a list of extension to mimetype in a INI file. However some extensions have multiple mimetypes, for example;
midi[] = "application/x-midi"
midi[] = "audio/midi"
midi[] = "audio/x-mid"
midi[] = "audio/x-midi"
midi[] = "music/crescendo"
midi[] = "x-music/x-midi"
6 (possible) mimetypes for 1 extension. Whats common practice to determine the correct mimetype? (e.g. i need to set a HTTP content-type header).
I know its not ideal; determining mimetypes based on extension.. but i need consistent (cross-server) results (e.g. fileinfo extension in PHP is making terrible guesses*).
* Some fileinfo results for example;
js - text/plain
css - text/c-h