In Yii, you can use the CFileHelper class. If Fileinfo is available, CFileHelper will use that extension. If not, CFileHelper will use the mime_content_type() function or just the file’s extension (as the worst case scenario)
I was using latest version of WAMP and file_info extenstion was disabled. And Yii couldn't handle it correctly and throw exception that file_info is not available. So, file_info should be available, otherwise, Yii won't check the extension only and model rules wont pass.
Php File_Info
in The Yii Book
Posted
Hi Larry,
In working with model chapters, you mentioned:
I was using latest version of WAMP and file_info extenstion was disabled. And Yii couldn't handle it correctly and throw exception that file_info is not available. So, file_info should be available, otherwise, Yii won't check the extension only and model rules wont pass.