Class Zend_Validate_File_Upload

Description

Validator for the maximum size of a file up to a max of 2GB

  • copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  • license: New BSD License

Located in /Validate/File/Upload.php (line 35)

Zend_Validate_Abstract
   |
   --Zend_Validate_File_Upload
Class Constant Summary
 ATTACK = 'fileUploadErrorAttack'
 CANT_WRITE = 'fileUploadErrorCantWrite'
 EXTENSION = 'fileUploadErrorExtension'
 FILE_NOT_FOUND = 'fileUploadErrorFileNotFound'
 FORM_SIZE = 'fileUploadErrorFormSize'
 INI_SIZE = 'fileUploadErrorIniSize'
 NO_FILE = 'fileUploadErrorNoFile'
 NO_TMP_DIR = 'fileUploadErrorNoTmpDir'
 PARTIAL = 'fileUploadErrorPartial'
 UNKNOWN = 'fileUploadErrorUnknown'
Variable Summary
Method Summary
 array getFiles ([ $file = null], string $files)
 boolean isValid (string $value, [ $file = null])
 void __construct ([array|Zend_Config $files = array()])
 Zend_Validate_File_Upload setFiles ([array $files = array()])
 false _throw (string $file, string $errorType)
Variables
array $_files = array() (line 72)

Internal array of files

  • access: protected
array $_messageTemplates = 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%'"
)
(line 55)
  • var: Error message templates
  • access: protected

Redefinition of:
Zend_Validate_Abstract::$_messageTemplates
Validation failure message template definitions

Inherited Variables

Inherited from Zend_Validate_Abstract

Zend_Validate_Abstract::$_defaultTranslator
Zend_Validate_Abstract::$_errors
Zend_Validate_Abstract::$_messageLength
Zend_Validate_Abstract::$_messages
Zend_Validate_Abstract::$_messageVariables
Zend_Validate_Abstract::$_obscureValue
Zend_Validate_Abstract::$_translator
Zend_Validate_Abstract::$_translatorDisabled
Zend_Validate_Abstract::$_value
Methods
getFiles (line 100)

Returns the array of set files

  • throws: Zend_Validate_Exception If file is not found
  • access: public
array getFiles ([ $file = null], string $files)
  • string $files: (Optional) The file to return in detail
  • $file
isValid (line 157)

Defined by Zend_Validate_Interface

Returns true if and only if the file was uploaded without errors

  • access: public
boolean isValid (string $value, [ $file = null])
  • string $value: Single file to check for upload errors, when giving null the $_FILES array from initialization will be used
  • $file
Constructor __construct (line 84)

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!

  • access: public
void __construct ([array|Zend_Config $files = array()])
  • array|Zend_Config $files: Array of files in syntax of Zend_File_Transfer
setFiles (line 131)

Sets the files to be checked

  • return: Provides a fluent interface
  • access: public
Zend_Validate_File_Upload setFiles ([array $files = array()])
  • array $files: The files to check in syntax of Zend_File_Transfer
_throw (line 235)

Throws an error of the given type

  • access: protected
false _throw (string $file, string $errorType)
  • string $file
  • string $errorType

Inherited Methods

Inherited From Zend_Validate_Abstract

 Zend_Validate_Abstract::getDefaultTranslator()
 Zend_Validate_Abstract::getErrors()
 Zend_Validate_Abstract::getMessageLength()
 Zend_Validate_Abstract::getMessages()
 Zend_Validate_Abstract::getMessageTemplates()
 Zend_Validate_Abstract::getMessageVariables()
 Zend_Validate_Abstract::getObscureValue()
 Zend_Validate_Abstract::getTranslator()
 Zend_Validate_Abstract::hasDefaultTranslator()
 Zend_Validate_Abstract::hasTranslator()
 Zend_Validate_Abstract::setDefaultTranslator()
 Zend_Validate_Abstract::setDisableTranslator()
 Zend_Validate_Abstract::setMessage()
 Zend_Validate_Abstract::setMessageLength()
 Zend_Validate_Abstract::setMessages()
 Zend_Validate_Abstract::setObscureValue()
 Zend_Validate_Abstract::setTranslator()
 Zend_Validate_Abstract::translatorIsDisabled()
 Zend_Validate_Abstract::_createMessage()
 Zend_Validate_Abstract::_error()
 Zend_Validate_Abstract::_setValue()
 Zend_Validate_Abstract::__get()
Class Constants
ATTACK = 'fileUploadErrorAttack' (line 47)
CANT_WRITE = 'fileUploadErrorCantWrite' (line 45)
EXTENSION = 'fileUploadErrorExtension' (line 46)
FILE_NOT_FOUND = 'fileUploadErrorFileNotFound' (line 48)
FORM_SIZE = 'fileUploadErrorFormSize' (line 41)
INI_SIZE = 'fileUploadErrorIniSize' (line 40)
NO_FILE = 'fileUploadErrorNoFile' (line 43)
NO_TMP_DIR = 'fileUploadErrorNoTmpDir' (line 44)
PARTIAL = 'fileUploadErrorPartial' (line 42)
UNKNOWN = 'fileUploadErrorUnknown' (line 49)

Documentation generated on Mon, 21 Jun 2010 15:50:36 -0400 by phpDocumentor 1.4.3