PHP 5.2.6
Fileinfo installed through PECL

Checking certain MSWord files, I'm getting back (sans quotes) "application/msword application/msword". Someone reported (in the manual comments) this same thing back in 2007:

Can anyone shed any light on how/why this is happening? Specifically, is this a bug in Fileinfo, file (the app), the Word doc, or the magic file itself? I'd love to investigate this further but am having some trouble searching online. Narrowing it down to a specific target would be most helpful. I don't see anything about it at and I'd rather try to figure out if the problem is PHP-related before filing a bug.

For now, I'm doing the following:

$fi = new finfo(FILEINFO_MIME, FINFO_PATH);
$type = $fi->file($file['tmp_name']);

$split = explode(' ', $type);
$type = $split[0];

Pretty hackish. If anyone has a better solution in the meantime, I'd be most appreciative.

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to