If you try to upload DOCX and ODT files, symfony will recognise them as a ZIP archive. To corrrect this and the OpenOffice DOC mimetype problem, add the 'mime_type_guessers' option to sfValidatorFile:
$this->setValidator('filename', new sfValidatorFile(array( 'max_size' => ..., 'path' => ..., 'mime_type_guessers' => array('guessFromFileinfo'), 'required' => ..., ...
Thanks!
ReplyDelete