« Return to Thread: MIME Type detection function

MIME Type detection function

by Shahar Evron :: Rate this Message:

Reply to Author | View in Thread

Hi,

I was going to write a general purpose mime-type detection method. Right
now I use mime_magic to detect uploaded file's MIME type in
Zend_Http_Client but mime_magic is deprecated in favor of the fileinfo
extension.

Since both might or might not be available, and fileinfo is prefered, I
was going to write a wrapper function that would use fileinfo if
available, then mime_magic and if none are available, will do nothing.

I figure that this might be useful for other ZF components, and also for
users, and the most natural place for it is some static method of
Zend_Mime.

Any thoughts or better suggestions?

Shahar.

--
Best Regards,

Shahar Evron  <shahar.e@...>

Senior PHP Specialist         Product Group
Zend Technologies


signature.asc (204 bytes) Download Attachment

 « Return to Thread: MIME Type detection function

LightInTheBox - Buy quality products at wholesale price!