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 234 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.
setFiles | ( | $ | files = array() ) |
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.
$_messageTemplates [protected] |
array( self::INI_SIZE => "The file '%value%' exceeds the defined ini size", self::FORM_SIZE => "The file '%value%' exceeds the defined form size", self::PARTIAL => "The file '%value%' was only partially uploaded", self::NO_FILE => "The file '%value%' was not uploaded", self::NO_TMP_DIR => "No temporary directory was found for the file '%value%'", self::CANT_WRITE => "The file '%value%' can't be written", self::EXTENSION => "The extension returned an error while uploading the file '%value%'", self::ATTACK => "The file '%value%' was illegal uploaded, possible attack", self::FILE_NOT_FOUND => "The file '%value%' was not found", self::UNKNOWN => "Unknown error while uploading the file '%value%'" )
Reimplemented from Zend_Validate_Abstract.
Definition at line 55 of file Upload.php.
const INI_SIZE = 'fileUploadErrorIniSize' |
#+ string Error constants
Definition at line 40 of file Upload.php.