Note: This validator is redundant with CFileValidator, which already does the upload validations. Sorry.
(Note to self: Must read the core code more closely).
This validator will check the PHP upload status of a file and will throw the errors to the attribute.
Requirements ¶
Created and tested with Yii 1.1.9
Usage ¶
Download, unzip and copy the file. Example, into protected/extensions/validators
In your model, add the rule as follows.
public function rules() {
return array(
...
array('xmlFile', 'file', 'allowEmpty' => false, 'types' => 'xml'),
array('xmlFile', 'ext.validators.fileUploadErrorValidator'),
...
);
}
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.