I use this, after installing the magic extension on my system (OSX):

$finfo = new finfo(FILEINFO_MIME, "/usr/local/share/file/magic.mgc");
$filetype = $finfo->buffer($message['attachment'][0]['filedata']) . "\n";

To find magic.mgc on your system, use

locate magic.mgc

or

find / | grep magic.mgc.

/mathias

2008/12/19 djXternal <[email protected]>:
>
> I am trying to determine a file's MIME type that's on the server.  I
> have tried using the PHP finfo function, but came back with a cannot
> find function error.... Is there any other way of determining file
> type?
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to