Form/Element/File.php
- 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
- 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 $_maxFileSize = -1Maximum file size for MAX_FILE_SIZE attribut of form
-1Details- Type
- integer

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

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

_getErrorMessages() : arrayRetrieve error messages and perform translation and value substitution
| Type | Description |
|---|---|
| array |

addFilter(string | array $filter, string | array $options = null) : \Zend_Form_Element_FileAdd Filter; proxy to adapter
| Name | Type | Description |
|---|---|---|
| $filter | string | array | Type of filter to add |
| $options | string | array | Options to set for the filter |
| Type | Description |
|---|---|
| \Zend_Form_Element_File |

addFilters(array $filters) : \Zend_Form_Element_FileAdd Multiple filters at once; proxy to adapter
| Name | Type | Description |
|---|---|---|
| $filters | array |
| Type | Description |
|---|---|
| \Zend_Form_Element_File |

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

addValidator(string | \Zend_Validate_Interface $validator, bool $breakChainOnFailure = false, mixed $options = array()) : \Zend_Form_Element_FileAdd Validator; proxy to adapter
| Name | Type | Description |
|---|---|---|
| $validator | string | \Zend_Validate_Interface | |
| $breakChainOnFailure | bool | |
| $options | mixed |
| Type | Description |
|---|---|
| \Zend_Form_Element_File |

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

clearFilters() : \Zend_Form_Element_FileRemove all filters; proxy to adapter
| Type | Description |
|---|---|
| \Zend_Form_Element_File |

clearValidators() : \Zend_Form_Element_FileRemove all validators; proxy to adapter
| Type | Description |
|---|---|
| \Zend_Form_Element_File |

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

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

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

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

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

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

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

getPluginLoader(string $type) : \Zend_Loader_PluginLoader_InterfaceGet Plugin Loader
| Name | Type | Description |
|---|---|---|
| $type | string |
| Type | Description |
|---|---|
| \Zend_Loader_PluginLoader_Interface |

getTransferAdapter() : \Zend_File_Transfer_Adapter_AbstractGet transfer adapter
| Type | Description |
|---|---|
| \Zend_File_Transfer_Adapter_Abstract |

getTranslator() : \Zend_Translate_Adapter | nullRetrieve localization translator object
| Type | Description |
|---|---|
| \Zend_Translate_Adapter | null |

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

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

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

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

loadDefaultDecorators() : \Zend_Form_Element_FileLoad default decorators
| Type | Description |
|---|---|
| \Zend_Form_Element_File |

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

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

render(\Zend_View_Interface $view = null) : stringRender form element Checks for decorator interface to prevent errors
| Name | Type | Description |
|---|---|---|
| $view | \Zend_View_Interface |
| Type | Description |
|---|---|
| string |
| Exception | Description |
|---|---|
| \Zend_Form_Element_Exception |

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

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

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

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

setMultiFile(integer $count) : \Zend_Form_Element_FileSet a multifile element
| Name | Type | Description |
|---|---|---|
| $count | integer | Number of file elements |
| Type | Description |
|---|---|
| \Zend_Form_Element_File | Provides fluent interface |

setPluginLoader(\Zend_Loader_PluginLoader_Interface $loader, string $type) : \Zend_Form_Element_FileSet plugin loader
| Name | Type | Description |
|---|---|---|
| $loader | \Zend_Loader_PluginLoader_Interface | |
| $type | string |
| Type | Description |
|---|---|
| \Zend_Form_Element_File |

setTransferAdapter(string | \Zend_File_Transfer_Adapter_Abstract $adapter) : \Zend_Form_Element_FileSet transfer adapter
| Name | Type | Description |
|---|---|---|
| $adapter | string | \Zend_File_Transfer_Adapter_Abstract |
| Type | Description |
|---|---|
| \Zend_Form_Element_File |
| Exception | Description |
|---|---|
| \Zend_Form_Element_Exception |

setTranslator(\Zend_Translate | null $translator = null) : \Zend_Form_Element_FileSet translator object for localization
| Name | Type | Description |
|---|---|---|
| $translator | \Zend_Translate | null |
| Type | Description |
|---|---|
| \Zend_Form_Element_File |

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

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

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()
| Name | Type | Description |
|---|---|---|
| $flag | boolean | Sets if the file is handled as the elements value |
| Type | Description |
|---|---|
| \Zend_Form_Element_File |