chaiwei Posted October 8, 2009 Share Posted October 8, 2009 Hi, Currently my hosting does not support the fileinfo and mime_content_type() I have try the system("file -i abc.php"), But it returns me text/x-c++ , so is there any other ways to get the correct file mime? thanks in advance. Link to comment https://forums.phpfreaks.com/topic/176949-php-get-file-mime/ Share on other sites More sharing options...
Bricktop Posted October 8, 2009 Share Posted October 8, 2009 Hi chaiwei, Have a look at this class which should do exactly what you need. http://www.phpclasses.org/browse/file/2743.html Hope this helps. Link to comment https://forums.phpfreaks.com/topic/176949-php-get-file-mime/#findComment-932994 Share on other sites More sharing options...
chaiwei Posted October 10, 2009 Author Share Posted October 10, 2009 Hi, Thanks for your response. But it am afraid that that class is not suitable for me in my situation. Is there any other ways? Link to comment https://forums.phpfreaks.com/topic/176949-php-get-file-mime/#findComment-934106 Share on other sites More sharing options...
trq Posted October 10, 2009 Share Posted October 10, 2009 Is Zend_Mime helpful? Link to comment https://forums.phpfreaks.com/topic/176949-php-get-file-mime/#findComment-934109 Share on other sites More sharing options...
trq Posted October 10, 2009 Share Posted October 10, 2009 Sorry, that's not even the right class. There's a Mimetype validator within Zend's Zend_File that might be useful. Link to comment https://forums.phpfreaks.com/topic/176949-php-get-file-mime/#findComment-934112 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.