I have 开发者_C百科a file upload field and in my configure()
I've putted 'mime_types' => 'web_images'
but this give me an error when I upload pdf files... what do I nedd to write instead of web_images
to be able to upload pdf's? Thank you.
Remove 'mime_types' => 'web_images'
You have to set right mime category:
$this->setValidator('my_upload_widget', new sfValidatorFile(array(
'required' => false,
'path' => sfConfig::get('sf_upload_pdf_dir'),
'mime_categories' => array('pdf' => array('application/pdf', 'application/x-pdf')),
'mime_types' => 'pdf'
)));
精彩评论