Validate/File/Upload.php

Show: PublicProtectedPrivateinherited
Table of Contents
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_Validate
Validator 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

>VConstant  INI_SIZE = 'fileUploadErrorIniSize'
>VConstant  FORM_SIZE = 'fileUploadErrorFormSize'
>VConstant  PARTIAL = 'fileUploadErrorPartial'
>VConstant  NO_FILE = 'fileUploadErrorNoFile'
>VConstant  NO_TMP_DIR = 'fileUploadErrorNoTmpDir'
>VConstant  CANT_WRITE = 'fileUploadErrorCantWrite'
>VConstant  EXTENSION = 'fileUploadErrorExtension'
>VConstant  ATTACK = 'fileUploadErrorAttack'
>VConstant  FILE_NOT_FOUND = 'fileUploadErrorFileNotFound'
>VConstant  UNKNOWN = 'fileUploadErrorUnknown'

Properties

Methods

methodpublic__construct(array | \Zend_Config $files = array()) : void

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!
Parameters
NameTypeDescription
$filesarray | \Zend_Config

Array of files in syntax of Zend_File_Transfer

methodpublicgetFiles( $file = null) : array

Returns the array of set files

Parameters
NameTypeDescription
$file
Returns
TypeDescription
array
Throws
ExceptionDescription
\Zend_Validate_ExceptionIf file is not found
methodpublicisValid(string $value,  $file = null) : boolean

Defined by Zend_Validate_Interface

Returns true if and only if the file was uploaded without errors
Parameters
NameTypeDescription
$valuestring

Single file to check for upload errors, when giving null the $_FILES array

                  from initialization will be used
$file
Returns
TypeDescription
boolean
methodpublicsetFiles(array $files = array()) : \Zend_Validate_File_Upload

Sets the files to be checked

Parameters
NameTypeDescription
$filesarray

The files to check in syntax of Zend_File_Transfer

Returns
TypeDescription
\Zend_Validate_File_UploadProvides a fluent interface
Documentation was generated by phpDocumentor 2.2.0 .