file-upload-error-validator Validates PHP error status for an uploaded file

  1. Requirements
  2. Usage

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'),
1 0
1 follower
Yii Version: 1.1
License: BSD-2-Clause
Category: Validation
Developed by: jmariani
Created on: Jan 28, 2012
Last updated: 9 years ago


show all

Related Extensions