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文件)。