FileInput is a special Input type for handling uploaded files.

It differs from Input in a few ways:

  1. It expects the raw value to be in the $_FILES array format.

  2. The validators are run before the filters (the opposite behavior of Input). This is so is_uploaded_file() validation can be run prior to any filters that may rename/move/modify the file.

  3. Instead of adding a NotEmpty validator, it will (by default) automatically add a Zend\Validator\File\Upload validator.

 Methods

__construct()

__construct($name) 
Inherited

inherited_from \Zend\InputFilter\Input::__construct()

Parameters

$name

allowEmpty()

allowEmpty() : bool
Inherited

inherited_from \Zend\InputFilter\Input::allowEmpty()

Returns

bool

breakOnFailure()

breakOnFailure() : bool
Inherited

inherited_from \Zend\InputFilter\Input::breakOnFailure()

Returns

bool

clearFallbackValue()

clearFallbackValue() 
Inherited

inherited_from \Zend\InputFilter\Input::clearFallbackValue()

continueIfEmpty()

continueIfEmpty() : bool
Inherited

inherited_from \Zend\InputFilter\Input::continueIfEmpty()

Returns

bool

getAutoPrependUploadValidator()

getAutoPrependUploadValidator() : bool

Returns

bool

getErrorMessage()

getErrorMessage() : string | null
Inherited

inherited_from \Zend\InputFilter\Input::getErrorMessage()

Returns

stringnull

getFallbackValue()

getFallbackValue() : mixed
Inherited

inherited_from \Zend\InputFilter\Input::getFallbackValue()

Returns

mixed

getFilterChain()

getFilterChain() : \Zend\Filter\FilterChain
Inherited

inherited_from \Zend\InputFilter\Input::getFilterChain()

Returns

getMessages()

getMessages() : array
Inherited

inherited_from \Zend\InputFilter\Input::getMessages()

Returns

array

getName()

getName() : string
Inherited

inherited_from \Zend\InputFilter\Input::getName()

Returns

string

getRawValue()

getRawValue() : mixed
Inherited

inherited_from \Zend\InputFilter\Input::getRawValue()

Returns

mixed

getValidatorChain()

getValidatorChain() : \Zend\Validator\ValidatorChain
Inherited

inherited_from \Zend\InputFilter\Input::getValidatorChain()

Returns

getValue()

getValue() : mixed

Returns

mixed

hasFallback()

hasFallback() : bool
Inherited

inherited_from \Zend\InputFilter\Input::hasFallback()

Returns

bool

Checks if the raw input value is an empty file input eg: no file was uploaded

isEmptyFile($rawValue) : bool

Parameters

$rawValue

Returns

bool

isRequired()

isRequired() : bool
Inherited

inherited_from \Zend\InputFilter\Input::isRequired()

Returns

bool

isValid()

isValid(mixed $context) : bool

Parameters

$context

mixed

Extra "context" to provide the validator

Returns

bool

merge()

merge(\Zend\InputFilter\InputInterface $input) : \Zend\InputFilter\FileInput

setAllowEmpty()

setAllowEmpty(bool $allowEmpty) : \Zend\InputFilter\Input
Inherited

inherited_from \Zend\InputFilter\Input::setAllowEmpty()

Parameters

$allowEmpty

bool

Returns

setAutoPrependUploadValidator()

setAutoPrependUploadValidator(bool $value) : \Zend\InputFilter\FileInput

Parameters

$value

bool

Enable/Disable automatically prepending an Upload validator

Returns

setBreakOnFailure()

setBreakOnFailure(bool $breakOnFailure) : \Zend\InputFilter\Input
Inherited

inherited_from \Zend\InputFilter\Input::setBreakOnFailure()

Parameters

$breakOnFailure

bool

Returns

setContinueIfEmpty()

setContinueIfEmpty(bool $continueIfEmpty) : \Zend\InputFilter\Input
Inherited

inherited_from \Zend\InputFilter\Input::setContinueIfEmpty()

Parameters

$continueIfEmpty

bool

Returns

setErrorMessage()

setErrorMessage(string | null $errorMessage) : \Zend\InputFilter\Input
Inherited

inherited_from \Zend\InputFilter\Input::setErrorMessage()

Parameters

$errorMessage

stringnull

Returns

setFallbackValue()

setFallbackValue(mixed $value) : \Zend\InputFilter\Input
Inherited

inherited_from \Zend\InputFilter\Input::setFallbackValue()

Parameters

$value

mixed

Returns

setFilterChain()

setFilterChain(\Zend\Filter\FilterChain $filterChain) : \Zend\InputFilter\Input
Inherited

inherited_from \Zend\InputFilter\Input::setFilterChain()

Parameters

Returns

setName()

setName(string $name) : \Zend\InputFilter\Input
Inherited

inherited_from \Zend\InputFilter\Input::setName()

Parameters

$name

string

Returns

setRequired()

setRequired(bool $required) : \Zend\InputFilter\Input
Inherited

inherited_from \Zend\InputFilter\Input::setRequired()

Parameters

$required

bool

Returns

setValidatorChain()

setValidatorChain(\Zend\Validator\ValidatorChain $validatorChain) : \Zend\InputFilter\Input
Inherited

inherited_from \Zend\InputFilter\Input::setValidatorChain()

Parameters

Returns

setValue()

setValue(mixed $value) : \Zend\InputFilter\Input
Inherited

inherited_from \Zend\InputFilter\Input::setValue()

Parameters

$value

mixed

Returns

No-op, NotEmpty validator does not apply for FileInputs.

injectNotEmptyValidator() : void

See also: BaseInputFilter::isValid()

injectUploadValidator()

injectUploadValidator() : void

 Properties

 

$allowEmpty

$allowEmpty : bool
Inherited

inherited_from \Zend\InputFilter\Input::$$allowEmpty
 

$autoPrependUploadValidator

$autoPrependUploadValidator : bool

 

$breakOnFailure

$breakOnFailure : bool
Inherited

inherited_from \Zend\InputFilter\Input::$$breakOnFailure
 

$continueIfEmpty

$continueIfEmpty : bool
Inherited

inherited_from \Zend\InputFilter\Input::$$continueIfEmpty
 

$errorMessage

$errorMessage : string | null
Inherited

inherited_from \Zend\InputFilter\Input::$$errorMessage
 

$fallbackValue

$fallbackValue : mixed
Inherited

inherited_from \Zend\InputFilter\Input::$$fallbackValue
 

$filterChain

$filterChain : \Zend\Filter\FilterChain
Inherited

inherited_from \Zend\InputFilter\Input::$$filterChain
 

$hasFallback

$hasFallback : bool
Inherited

inherited_from \Zend\InputFilter\Input::$$hasFallback
 

$isValid

$isValid : bool

 

$name

$name : string
Inherited

inherited_from \Zend\InputFilter\Input::$$name
 

$notEmptyValidator

$notEmptyValidator : bool
Inherited

inherited_from \Zend\InputFilter\Input::$$notEmptyValidator
 

$required

$required : bool
Inherited

inherited_from \Zend\InputFilter\Input::$$required
 

$validatorChain

$validatorChain : \Zend\Validator\ValidatorChain
Inherited

inherited_from \Zend\InputFilter\Input::$$validatorChain
 

$value

$value : mixed
Inherited

inherited_from \Zend\InputFilter\Input::$$value