|
Moodle
2.2.1
http://www.collinsharper.com
|


Public Member Functions | |
| __construct ($files=array()) | |
| getFiles ($file=null) | |
| setFiles ($files=array()) | |
| isValid ($value, $file=null) | |
Data Fields | |
| const | INI_SIZE = 'fileUploadErrorIniSize' |
| const | FORM_SIZE = 'fileUploadErrorFormSize' |
| const | PARTIAL = 'fileUploadErrorPartial' |
| const | NO_FILE = 'fileUploadErrorNoFile' |
| const | NO_TMP_DIR = 'fileUploadErrorNoTmpDir' |
| const | CANT_WRITE = 'fileUploadErrorCantWrite' |
| const | EXTENSION = 'fileUploadErrorExtension' |
| const | ATTACK = 'fileUploadErrorAttack' |
| const | FILE_NOT_FOUND = 'fileUploadErrorFileNotFound' |
| const | UNKNOWN = 'fileUploadErrorUnknown' |
Protected Member Functions | |
| _throw ($file, $errorType) | |
Protected Attributes | |
| $_messageTemplates | |
| $_files = array() | |
Definition at line 35 of file Upload.php.
| __construct | ( | $ | files = array() | ) |
Sets validator options
The array $files must be given in syntax of Zend_File_Transfer to be checked If no files are given the $_FILES array will be used automatically. NOTE: This validator will only work with HTTP POST uploads!
| array | Zend_Config | $files | Array of files in syntax of Zend_File_Transfer |
Definition at line 84 of file Upload.php.

| _throw | ( | $ | file, |
| $ | errorType | ||
| ) | [protected] |
Throws an error of the given type
| string | $file | |
| string | $errorType |
Definition at line 235 of file Upload.php.


| getFiles | ( | $ | file = null | ) |
Returns the array of set files
| string | $files | (Optional) The file to return in detail |
| Zend_Validate_Exception | If file is not found |
Definition at line 100 of file Upload.php.
| isValid | ( | $ | value, |
| $ | file = null |
||
| ) |
Defined by Zend_Validate_Interface
Returns true if and only if the file was uploaded without errors
| string | $value | Single file to check for upload errors, when giving null the $_FILES array from initialization will be used |
Definition at line 157 of file Upload.php.

Sets the files to be checked
| array | $files | The files to check in syntax of Zend_File_Transfer |
Definition at line 131 of file Upload.php.

$_files = array() [protected] |
Definition at line 72 of file Upload.php.
$_messageTemplates [protected] |
array( self::INI_SIZE => "File '%value%' exceeds the defined ini size", self::FORM_SIZE => "File '%value%' exceeds the defined form size", self::PARTIAL => "File '%value%' was only partially uploaded", self::NO_FILE => "File '%value%' was not uploaded", self::NO_TMP_DIR => "No temporary directory was found for file '%value%'", self::CANT_WRITE => "File '%value%' can't be written", self::EXTENSION => "A PHP extension returned an error while uploading the file '%value%'", self::ATTACK => "File '%value%' was illegally uploaded. This could be a possible attack", self::FILE_NOT_FOUND => "File '%value%' was not found", self::UNKNOWN => "Unknown error while uploading file '%value%'" )
Reimplemented from Zend_Validate_Abstract.
Definition at line 55 of file Upload.php.
| const ATTACK = 'fileUploadErrorAttack' |
Definition at line 47 of file Upload.php.
| const CANT_WRITE = 'fileUploadErrorCantWrite' |
Definition at line 45 of file Upload.php.
| const EXTENSION = 'fileUploadErrorExtension' |
Definition at line 46 of file Upload.php.
| const FILE_NOT_FOUND = 'fileUploadErrorFileNotFound' |
Definition at line 48 of file Upload.php.
| const FORM_SIZE = 'fileUploadErrorFormSize' |
Definition at line 41 of file Upload.php.
| const INI_SIZE = 'fileUploadErrorIniSize' |
#+ string Error constants
Definition at line 40 of file Upload.php.
| const NO_FILE = 'fileUploadErrorNoFile' |
Definition at line 43 of file Upload.php.
| const NO_TMP_DIR = 'fileUploadErrorNoTmpDir' |
Definition at line 44 of file Upload.php.
| const PARTIAL = 'fileUploadErrorPartial' |
Definition at line 42 of file Upload.php.
| const UNKNOWN = 'fileUploadErrorUnknown' |
Definition at line 49 of file Upload.php.