Is there any decent way in PHP to get the mime type?
I have been searching extensively the past few hours and it seems like there are three main ways, which each way having problems:
mime_content_type() This is deprecated, alot of the times not installed, and if installed will sometimes not find the mime.magic file.
file_info Wasn't installed on the hosts I tried, doesn't seem to have very good support. Is an extension (PECL).
shell_exec(file -ib . $file) Doesn't work on windows servers. I tried it on a linux server and it gave me "image/x-3ds2" for a php file. What the hell is that!!!
What is a good, almost bullet proof way to get the mime type of a file?