Validate/File/Upload.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled
with this package in the file LICENSE.txt.
It is also available through the world-wide-web at this URL:
http://framework.zend.com/license/new-bsd
If you did not receive a copy of the license and are unable to
obtain it through the world-wide-web, please send an email
to license@zend.com so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Validate
- Version
- $Id$
\Zend_Validate_File_Upload
Package: Zend_ValidateValidator for the maximum size of a file up to a max of 2GB
- Parent(s)
- \Zend_Validate_Abstract
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants
Properties



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%'")Default valuearray(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%'")Details- Type
- array
Methods



__construct(array | \Zend_Config $files = array()) : voidThe 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!
Parameters| Name | Type | Description |
|---|
| $files | array | \Zend_Config | Array of files in syntax of Zend_File_Transfer |
|---|



_throw(string $file, string $errorType) : falseThrows an error of the given type
Parameters| Name | Type | Description |
|---|
| $file | string | |
|---|
| $errorType | string | |
|---|
Returns 


isValid(string $value, $file = null) : booleanDefined by Zend_Validate_Interface
Returns true if and only if the file was uploaded without errors
Parameters| Name | Type | Description |
|---|
| $value | string | Single file to check for upload errors, when giving null the $_FILES array
from initialization will be used
|
|---|
| $file | | |
|---|
Returns


setFiles(array $files = array()) : \Zend_Validate_File_UploadSets the files to be checked
Parameters| Name | Type | Description |
|---|
| $files | array | The files to check in syntax of Zend_File_Transfer |
|---|
Returns