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 = 1Internal multifile counter
Default value1Details- Type
- integer



integer $_maxFileSize = -1staticMaximum file size for MAX_FILE_SIZE attribut of form
Default value-1Details- Type
- integer



boolean $_valueDisabled = falseDisable value to be equal to file content
Default valuefalseDetails- Type
- boolean
Methods



_convertIniToInteger(string $setting) : integerConverts a ini setting to a integer value
Parameters| Name | Type | Description |
|---|
| $setting | string | |
|---|
Returns 


addFilter(string | array $filter, string | array $options = null) : \Zend_Form_Element_FileAdd Filter; proxy to adapter
Parameters| Name | 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_FileAdd Multiple filters at once; proxy to adapter
Parameters| Name | Type | Description |
|---|
| $filters | array | |
|---|
Returns 


addPrefixPath(string $prefix, string $path, string $type = null) : \Zend_Form_Element_FileAdd prefix path for plugin loader
Parameters| Name | Type | Description |
|---|
| $prefix | string | |
|---|
| $path | string | |
|---|
| $type | string | |
|---|
Returns 


addValidators(array $validators) : \Zend_Form_Element_FileAdd multiple validators at once; proxy to adapter
Parameters| Name | Type | Description |
|---|
| $validators | array | |
|---|
Returns 


getFileInfo(string $value = null) : arrayGet internal file informations
Parameters| Name | Type | Description |
|---|
| $value | string | (Optional) Element or file to return |
|---|
Returns 


getFileName(string $value = null, boolean $path = true) : stringParameters| Name | Type | Description |
|---|
| $value | string | (Optional) Element or file to return |
|---|
| $path | boolean | (Optional) Return also the path, defaults to true |
|---|
Returns 


getFileSize() : string | arrayReturns the filesize for this file element
Returns| Type | Description |
|---|
| string | array | Filesize |



getFilter(string $name) : \Zend_Filter_Interface | nullRetrieve individual filter; proxy to adapter
Parameters| Name | Type | Description |
|---|
| $name | string | |
|---|
Returns 


getFilters() : arrayReturns all set filters; proxy to adapter
Returns| Type | Description |
|---|
| array | List of set filters |



getHash(string $hash = 'crc32') : string | arrayReturns the hash for this file element
Parameters| Name | Type | Description |
|---|
| $hash | string | (Optional) Hash algorithm to use |
|---|
Returns| Type | Description |
|---|
| string | array | Hashstring |



getMimeType() : string | arrayReturns the mimetype for this file element
Returns| Type | Description |
|---|
| string | array | Mimetype |



getValidator(string $name) : \Zend_Validate_Interface | nullRetrieve validator by name; proxy to adapter
Parameters| Name | Type | Description |
|---|
| $name | string | |
|---|
Returns 


getValue() : null | stringProcesses the file, returns null or the filename only
For the complete path, use getFileName
Returns| Type | Description |
|---|
| null | string | |



isValid(string $value, mixed $context = null) : boolParameters| Name | Type | Description |
|---|
| $value | string | File, can be optional, give null to validate all files |
|---|
| $context | mixed | |
|---|
Returns 


isValueDisabled() : booleanReturns if the file will be uploaded when calling getValues()
Returns| Type | Description |
|---|
| boolean | Receive the file on calling getValues()? |



removeFilter(string $name) : \Zend_Form_Element_FileRemove an individual filter; proxy to adapter
Parameters| Name | Type | Description |
|---|
| $name | string | |
|---|
Returns 


removeValidator(string $name) : \Zend_Form_Element_FileRemove validator by name; proxy to adapter
Parameters| Name | Type | Description |
|---|
| $name | string | |
|---|
Returns 


setDestination(string $path) : \Zend_Form_Element_FileSet the upload destination
Parameters| Name | Type | Description |
|---|
| $path | string | |
|---|
Returns 


setDisableTranslator(bool $flag) : \Zend_Form_Element_FileIndicate whether or not translation should be disabled
Parameters| Name | Type | Description |
|---|
| $flag | bool | |
|---|
Returns 


setFilters(array $filters) : \Zend_Form_Element_FileSets a filter for the class, erasing all previous set; proxy to adapter
Parameters| Name | Type | Description |
|---|
| $filters | array | Filters to set |
|---|
Returns 


setMaxFileSize(integer $size) : integerSets the maximum file size of the form
Parameters| Name | Type | Description |
|---|
| $size | integer | |
|---|
Returns 


setMultiFile(integer $count) : \Zend_Form_Element_FileParameters| Name | Type | Description |
|---|
| $count | integer | Number of file elements |
|---|
Returns 


setValidators(array $validators) : \Zend_Form_Element_FileAdd multiple validators at once, overwriting; proxy to adapter
Parameters| Name | Type | Description |
|---|
| $validators | array | |
|---|
Returns 


setValue(mixed $value) : \Zend_Form_Element_FileDisallow setting the value
Parameters| Name | Type | Description |
|---|
| $value | mixed | |
|---|
Returns 


setValueDisabled(boolean $flag) : \Zend_Form_Element_FileSet if the file will be uploaded when getting the value
This defaults to false which will force receive() when calling getValues()
Parameters| Name | Type | Description |
|---|
| $flag | boolean | Sets if the file is handled as the elements value |
|---|
Returns