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.
Created and tested with Yii 1.1.9
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'), ... ); }
Be the first person to leave a comment
Please login to leave your comment.