API Documentation

Validate/File/Upload.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Validate
version
$Id: Upload.php 22399 2010-06-09 19:08:28Z thomas $
Classes
Zend_Validate_File_Upload

Description

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.

Zend_Validate_File_Upload

Extends from
Zend_Validate_Abstract
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Validate
Constants
INI_SIZE
FORM_SIZE
PARTIAL
NO_FILE
NO_TMP_DIR
CANT_WRITE
EXTENSION
ATTACK
FILE_NOT_FOUND
UNKNOWN
Properties
$_messageTemplates
$_files
Methods
__construct
getFiles
setFiles
isValid
_throw

Description

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

Constants

INI_SIZE

 INI_SIZE = 'fileUploadErrorIniSize'

Details

value
fileUploadErrorIniSize

FORM_SIZE

 FORM_SIZE = 'fileUploadErrorFormSize'

Details

value
fileUploadErrorFormSize

PARTIAL

 PARTIAL = 'fileUploadErrorPartial'

Details

value
fileUploadErrorPartial

NO_FILE

 NO_FILE = 'fileUploadErrorNoFile'

Details

value
fileUploadErrorNoFile

NO_TMP_DIR

 NO_TMP_DIR = 'fileUploadErrorNoTmpDir'

Details

value
fileUploadErrorNoTmpDir

CANT_WRITE

 CANT_WRITE = 'fileUploadErrorCantWrite'

Details

value
fileUploadErrorCantWrite

EXTENSION

 EXTENSION = 'fileUploadErrorExtension'

Details

value
fileUploadErrorExtension

ATTACK

 ATTACK = 'fileUploadErrorAttack'

Details

value
fileUploadErrorAttack

FILE_NOT_FOUND

 FILE_NOT_FOUND = 'fileUploadErrorFileNotFound'

Details

value
fileUploadErrorFileNotFound

UNKNOWN

 UNKNOWN = 'fileUploadErrorUnknown'

Details

value
fileUploadErrorUnknown

Properties

$_files

array $_files = 'array'

Internal array of files

Details

$_files
array
visibility
protected
default
array
final
false
static
false

$_messageTemplates

array $_messageTemplates = 'array'

Details

$_messageTemplates
array
Error message templates
visibility
protected
default
array
final
false
static
false

Methods

__construct

__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!

Arguments
$files
arrayZend_Config
Array of files in syntax of Zend_File_Transfer
Details
visibility
public
final
false
static
false

_throw

_throw( string $file, string $errorType ) : false

Throws an error of the given type

Arguments
$file
string
$errorType
string
Output
false
Details
visibility
protected
final
false
static
false

getFiles

getFiles(  $file = null ) : array

Returns the array of set files

Arguments
$file
Output
array
Details
visibility
public
final
false
static
false
throws
If file is not found

isValid

isValid( string $value,  $file = null ) : boolean

Defined by Zend_Validate_Interface

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

Arguments
$value
string
Single file to check for upload errors, when giving null the $_FILES array from initialization will be used
$file
Output
boolean
Details
visibility
public
final
false
static
false

setFiles

setFiles( array $files = array ) : Zend_Validate_File_Upload

Sets the files to be checked

Arguments
$files
array
The files to check in syntax of Zend_File_Transfer
Output
Zend_Validate_File_Upload
Provides a fluent interface
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.