Page 1 of 1

Mime Type returned by 'file -bi'

Posted: Thu Mar 01, 2007 8:38 am
by mikesmith76
Hi,

I'm using the file-bi command to return the mime type of an uploaded file (in PHP). I'm doing it this way as for some reason mime_content_type doesn't exist on my server. All was working well until this morning when I could out that for some reason this command is returning application/msword for powerpoint presentations.

I may be completely wrong here but i think this has something to do with the file /usr/share/magic.mime. From what i've read i'm guessing this file is used to detect the mime type when using the 'file -bi' command. I tried searching for an up-to-date version of the file, thinking mine was out of date, without success.

In short does anyone know how i can get the correct mime type of a file using PHP, or how I can update the file command to return the correct mime type.

Thanks for your assistance
Mike

Posted: Thu Mar 01, 2007 2:29 pm
by Christopher