English 中文(简体)
地名表 不为Word Document女士工作的有效性
原标题:symfony forms file upload Validation not working for Ms Word Document

I am using Symfony 1.4 and Propel as ORM. I have created a form using the Symfony Form, which contains some text inputs and file upload elements. The form structure,

$this->setWidgets(array(
             name             =>new sfWidgetFormInput(),
             mobile           =>new sfWidgetFormInput(),
             resume           =>new sfWidgetFormInputFile()
    ));
$mime_array=array("application/pdf","application/msword");
$this->setValidators(array(
              name             =>new sfValidatorString(array( required  => true)),
              mobile           =>new sfValidatorAnd(array(new sfValidatorNumber(),new sfValidatorString(array( required  => true,  min_length  => 10,  max_length  => 10)))), 
              resume           =>new sfValidatorFile(array( mime_types  => $mime_array))
    ));

但是,档案库没有为Word女士的档案工作,而是为PDF文档工作(因为用户可以上载PDF或Word文件)。

最佳回答

并非完全确定,但我想到的是,2007年的新办公室,“docs”一词要求有不同的奇迹:

application/vnd.openxmlformats-officedocument.wordprocessingml.document

(除你阵列之外,待测试)

我认为,另一种是使用旧文字。

http://www.vladville.com/2007/04/office-2007-mime-types-for-apache.html

问题回答

暂无回答




相关问题
To populate select options at backend using Symfony?

the symfony form is, nation =>new sfWidgetFormChoice(array( choices => NationPeer::getAllNation())), township =>new sfWidgetFormChoice(array( choices => TownshipPeer::...

Seriously speeding up PHP?

I ve been writing PHP for years, and have used every framework under the sun, but one thing has always bugged me... and that s that the whole bloody thing has to be interpreted and executed every time ...

How to unit-test an enterprise symfony project?

I´m working on a huge project at my work. We have about 200 database tables, accordingly a huge number of Models, Actions and so on. How should I begin to write tests for this? My biggest problem ...

edit profile from frontend - symfony

I succeeded to create a register form, and now users can register my site. But I can t create a form where users can edit their profile. I have sf_guard_user and sf_guard_user_profile in my schema....

热门标签