Mime Type returned by 'file -bi'

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
mikesmith76
Forum Commoner
Posts: 34
Joined: Fri Aug 25, 2006 7:10 am
Location: Manchester, UK

Mime Type returned by 'file -bi'

Post 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
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

(#10850)
Post Reply