Form/Element/File.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_Form
\Zend_Form_Element_File
Package: Zend_Form\ElementZend_Form_Element
- Parent(s)
- \Zend_Form_Element_Xhtml
<
\Zend_Form_Element
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Version
- $Id$
Constants
Properties
integer $_counter = 1
Internal multifile counter
Default value1
Details- Type
- integer
integer $_maxFileSize = -1
staticMaximum file size for MAX_FILE_SIZE attribut of form
Default value-1
Details- Type
- integer
boolean $_valueDisabled = false
Disable value to be equal to file content
Default valuefalse
Details- Type
- boolean
Methods
_convertIniToInteger(string $setting) : integer
Converts a ini setting to a integer value
ParametersName | Type | Description |
---|
$setting | string | |
---|
Returns addFilter(string | array $filter, string | array $options = null) : \Zend_Form_Element_File
Add Filter; proxy to adapter
ParametersName | Type | Description |
---|
$filter | string | array | Type of filter to add |
---|
$options | string | array | Options to set for the filter |
---|
Returns addFilters(array $filters) : \Zend_Form_Element_File
Add Multiple filters at once; proxy to adapter
ParametersName | Type | Description |
---|
$filters | array | |
---|
Returns addPrefixPath(string $prefix, string $path, string $type = null) : \Zend_Form_Element_File
Add prefix path for plugin loader
ParametersName | Type | Description |
---|
$prefix | string | |
---|
$path | string | |
---|
$type | string | |
---|
Returns addValidators(array $validators) : \Zend_Form_Element_File
Add multiple validators at once; proxy to adapter
ParametersName | Type | Description |
---|
$validators | array | |
---|
Returns getFileInfo(string $value = null) : array
Get internal file informations
ParametersName | Type | Description |
---|
$value | string | (Optional) Element or file to return |
---|
Returns getFileName(string $value = null, boolean $path = true) : string
ParametersName | Type | Description |
---|
$value | string | (Optional) Element or file to return |
---|
$path | boolean | (Optional) Return also the path, defaults to true |
---|
Returns getFileSize() : string | array
Returns the filesize for this file element
ReturnsType | Description |
---|
string | array | Filesize |
getFilter(string $name) : \Zend_Filter_Interface | null
Retrieve individual filter; proxy to adapter
ParametersName | Type | Description |
---|
$name | string | |
---|
Returns getFilters() : array
Returns all set filters; proxy to adapter
ReturnsType | Description |
---|
array | List of set filters |
getHash(string $hash = 'crc32') : string | array
Returns the hash for this file element
ParametersName | Type | Description |
---|
$hash | string | (Optional) Hash algorithm to use |
---|
ReturnsType | Description |
---|
string | array | Hashstring |
getMimeType() : string | array
Returns the mimetype for this file element
ReturnsType | Description |
---|
string | array | Mimetype |
getValidator(string $name) : \Zend_Validate_Interface | null
Retrieve validator by name; proxy to adapter
ParametersName | Type | Description |
---|
$name | string | |
---|
Returns getValue() : null | string
Processes the file, returns null or the filename only
For the complete path, use getFileName
ReturnsType | Description |
---|
null | string | |
isValid(string $value, mixed $context = null) : bool
ParametersName | Type | Description |
---|
$value | string | File, can be optional, give null to validate all files |
---|
$context | mixed | |
---|
Returns isValueDisabled() : boolean
Returns if the file will be uploaded when calling getValues()
ReturnsType | Description |
---|
boolean | Receive the file on calling getValues()? |
removeFilter(string $name) : \Zend_Form_Element_File
Remove an individual filter; proxy to adapter
ParametersName | Type | Description |
---|
$name | string | |
---|
Returns removeValidator(string $name) : \Zend_Form_Element_File
Remove validator by name; proxy to adapter
ParametersName | Type | Description |
---|
$name | string | |
---|
Returns setDestination(string $path) : \Zend_Form_Element_File
Set the upload destination
ParametersName | Type | Description |
---|
$path | string | |
---|
Returns setDisableTranslator(bool $flag) : \Zend_Form_Element_File
Indicate whether or not translation should be disabled
ParametersName | Type | Description |
---|
$flag | bool | |
---|
Returns setFilters(array $filters) : \Zend_Form_Element_File
Sets a filter for the class, erasing all previous set; proxy to adapter
ParametersName | Type | Description |
---|
$filters | array | Filters to set |
---|
Returns setMaxFileSize(integer $size) : integer
Sets the maximum file size of the form
ParametersName | Type | Description |
---|
$size | integer | |
---|
Returns setMultiFile(integer $count) : \Zend_Form_Element_File
ParametersName | Type | Description |
---|
$count | integer | Number of file elements |
---|
Returns setValidators(array $validators) : \Zend_Form_Element_File
Add multiple validators at once, overwriting; proxy to adapter
ParametersName | Type | Description |
---|
$validators | array | |
---|
Returns setValue(mixed $value) : \Zend_Form_Element_File
Disallow setting the value
ParametersName | Type | Description |
---|
$value | mixed | |
---|
Returns setValueDisabled(boolean $flag) : \Zend_Form_Element_File
Set if the file will be uploaded when getting the value
This defaults to false which will force receive() when calling getValues()
ParametersName | Type | Description |
---|
$flag | boolean | Sets if the file is handled as the elements value |
---|
Returns