This has stopped me for the last few hours.
$oFileInfo = new finfo( FILEINFO_MIME_TYPE );
$sMimeType = $oFileInfo -> file($_FILES['myfile']['tmp_name'] );
$upload = new Zend_File_Transfer_Adapter_Http();
$upload->addValidator('MimeType', true, array('application/pdf'));
$upload->isValid('myfile');
The code worked fine under Apache, PHP 5.2 (Zend Server), but now it is under Nginx, PHP-FPM, PHP 5.3. I would like to use the isValid () method to check my downloaded file, but the mime type does not work. Any suggestions?
source
share