This method will try to detect the MIME type of a file. If the fileinfo
extension is available, it will be used. If not, the mime_magic
extension which is deprected but is still available in many PHP setups
will be tried.
If neither extension is available, the default application/octet-stream
MIME type will be returned