Getting mime type from file name in php

If you check the documentation, you can see that you are not doing anything wrong.
But if you do a bit more research:

https://stackoverflow.com/a/3664655/3784145

you can see that the mime type you get is correct, but the extension doesn’t need to match with the mime type as explained here:

http://nl3.php.net/manual/en/function.mime-content-type.php#85879

I would therefore use the files suffix to determine the files mime type.
(as seen in the first example)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)