Class FileInput

Summary

Fully Qualified Name: Zend\InputFilter\FileInput
Extends: Input

Description

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 either be in the $_FILES array format, or an array of PSR-7 UploadedFileInterface instances.

  2. The validators are run before the filters (the opposite behavior of Input). This is so 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

Name Description Defined By
__construct() Input
allowEmpty() Input
breakOnFailure() Input
clearFallbackValue() Input
continueIfEmpty() Input
getAutoPrependUploadValidator() FileInput
getErrorMessage() Input
getFallbackValue() Input
getFilterChain() Input
getMessages() Input
getName() Input
getRawValue() Input
getValidatorChain() Input
getValue() FileInput
hasFallback() Input
hasValue() Flag for inform if input value was set. Input
isEmptyFile() Checks if the raw input value is an empty file input eg: no file was uploaded FileInput
isRequired() Input
isValid() FileInput
merge() FileInput
resetValue() FileInput
setAllowEmpty() Input
setAutoPrependUploadValidator() FileInput
setBreakOnFailure() Input
setContinueIfEmpty() Input
setErrorMessage() Input
setFallbackValue() Input
setFilterChain() Input
setName() Input
setRequired() Input
setValidatorChain() Input
setValue() FileInput

Method Details

__construct()

Parameter Name Type Description
$name

Returns: void

allowEmpty()

Returns: bool

breakOnFailure()

Returns: bool

clearFallbackValue()

Returns: void

continueIfEmpty()

Returns: bool

getAutoPrependUploadValidator()

Returns: bool

getErrorMessage()

Returns: string|null

getFallbackValue()

Returns: mixed

getFilterChain()

Returns: \FilterChain

getMessages()

Returns: string[]

getName()

Returns: string

getRawValue()

Returns: mixed

getValidatorChain()

Returns: \ValidatorChain

getValue()

Returns: mixed

hasFallback()

Returns: bool

hasValue()

Flag for inform if input value was set.

This flag used for distinguish when {@link Input::getValue()} will return the value previously set or the default.

Returns: bool

isEmptyFile()

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

Parameter Name Type Description
$rawValue
$rawValue

Returns: bool

isRequired()

Returns: bool

isValid()

Parameter Name Type Description
$context mixed Extra

Returns: bool

merge()

Parameter Name Type Description
$input \InputInterface

Returns: \FileInput

resetValue()

Returns: void

setAllowEmpty()

Parameter Name Type Description
$allowEmpty bool

Returns: \Input

setAutoPrependUploadValidator()

Parameter Name Type Description
$value bool Enable/Disable

Returns: \FileInput

setBreakOnFailure()

Parameter Name Type Description
$breakOnFailure bool

Returns: \Input

setContinueIfEmpty()

Parameter Name Type Description
$continueIfEmpty bool

Returns: \Input

setErrorMessage()

Parameter Name Type Description
$errorMessage string|null

Returns: \Input

setFallbackValue()

Parameter Name Type Description
$value mixed

Returns: \Input

setFilterChain()

Parameter Name Type Description
$filterChain \FilterChain

Returns: \Input

setName()

Parameter Name Type Description
$name string

Returns: \Input

setRequired()

Parameter Name Type Description
$required bool

Returns: \Input

setValidatorChain()

Parameter Name Type Description
$validatorChain \ValidatorChain

Returns: \Input

setValue()

Parameter Name Type Description
$value array|\UploadedFile

Returns: \Input

Top