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.

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

Downloads

show all

Related Extensions