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
![>](../images/icons/arrow_right.png)
![V](../images/icons/arrow_down.png)
![Property](../images/icons/property.png)
integer $_counter = 1
Internal multifile counter
Default value1
Details- Type
- integer
![>](../images/icons/arrow_right.png)
![V](../images/icons/arrow_down.png)
![Property](../images/icons/property.png)
integer $_maxFileSize = -1
staticMaximum file size for MAX_FILE_SIZE attribut of form
Default value-1
Details- Type
- integer
![>](../images/icons/arrow_right.png)
![V](../images/icons/arrow_down.png)
![Property](../images/icons/property.png)
boolean $_valueDisabled = false
Disable value to be equal to file content
Default valuefalse
Details- Type
- boolean
Methods
![](../images/icons/arrow_right.png)
![](../images/icons/arrow_down.png)
![method method](../images/icons/method.png)
_convertIniToInteger(string $setting) : integer
Converts a ini setting to a integer value
ParametersName | Type | Description |
---|
$setting | string | |
---|
Returns ![](../images/icons/arrow_right.png)
![](../images/icons/arrow_down.png)
![method method](../images/icons/method.png)
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 ![](../images/icons/arrow_right.png)
![](../images/icons/arrow_down.png)
![method method](../images/icons/method.png)
addFilters(array $filters) : \Zend_Form_Element_File
Add Multiple filters at once; proxy to adapter
ParametersName | Type | Description |
---|
$filters | array | |
---|
Returns ![](../images/icons/arrow_right.png)
![](../images/icons/arrow_down.png)
![method method](../images/icons/method.png)
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 ![](../images/icons/arrow_right.png)
![](../images/icons/arrow_down.png)
![method method](../images/icons/method.png)
addValidators(array $validators) : \Zend_Form_Element_File
Add multiple validators at once; proxy to adapter
ParametersName | Type | Description |
---|
$validators | array | |
---|
Returns ![](../images/icons/arrow_right.png)
![](../images/icons/arrow_down.png)
![method method](../images/icons/method.png)
getFileInfo(string $value = null) : array
Get internal file informations
ParametersName | Type | Description |
---|
$value | string | (Optional) Element or file to return |
---|
Returns ![](../images/icons/arrow_right.png)
![](../images/icons/arrow_down.png)
![method method](../images/icons/method.png)
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 ![](../images/icons/arrow_right.png)
![](../images/icons/arrow_down.png)
![method method](../images/icons/method.png)
getFileSize() : string | array
Returns the filesize for this file element
ReturnsType | Description |
---|
string | array | Filesize |
![](../images/icons/arrow_right.png)
![](../images/icons/arrow_down.png)
![method method](../images/icons/method.png)
getFilter(string $name) : \Zend_Filter_Interface | null
Retrieve individual filter; proxy to adapter
ParametersName | Type | Description |
---|
$name | string | |
---|
Returns ![](../images/icons/arrow_right.png)
![](../images/icons/arrow_down.png)
![method method](../images/icons/method.png)
getFilters() : array
Returns all set filters; proxy to adapter
ReturnsType | Description |
---|
array | List of set filters |
![](../images/icons/arrow_right.png)
![](../images/icons/arrow_down.png)
![method method](../images/icons/method.png)
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 |
![](../images/icons/arrow_right.png)
![](../images/icons/arrow_down.png)
![method method](../images/icons/method.png)
getMimeType() : string | array
Returns the mimetype for this file element
ReturnsType | Description |
---|
string | array | Mimetype |
![](../images/icons/arrow_right.png)
![](../images/icons/arrow_down.png)
![method method](../images/icons/method.png)
getValidator(string $name) : \Zend_Validate_Interface | null
Retrieve validator by name; proxy to adapter
ParametersName | Type | Description |
---|
$name | string | |
---|
Returns ![](../images/icons/arrow_right.png)
![](../images/icons/arrow_down.png)
![method method](../images/icons/method.png)
getValue() : null | string
Processes the file, returns null or the filename only
For the complete path, use getFileName
ReturnsType | Description |
---|
null | string | |
![](../images/icons/arrow_right.png)
![](../images/icons/arrow_down.png)
![method method](../images/icons/method.png)
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 ![](../images/icons/arrow_right.png)
![](../images/icons/arrow_down.png)
![method method](../images/icons/method.png)
isValueDisabled() : boolean
Returns if the file will be uploaded when calling getValues()
ReturnsType | Description |
---|
boolean | Receive the file on calling getValues()? |
![](../images/icons/arrow_right.png)
![](../images/icons/arrow_down.png)
![method method](../images/icons/method.png)
removeFilter(string $name) : \Zend_Form_Element_File
Remove an individual filter; proxy to adapter
ParametersName | Type | Description |
---|
$name | string | |
---|
Returns ![](../images/icons/arrow_right.png)
![](../images/icons/arrow_down.png)
![method method](../images/icons/method.png)
removeValidator(string $name) : \Zend_Form_Element_File
Remove validator by name; proxy to adapter
ParametersName | Type | Description |
---|
$name | string | |
---|
Returns ![](../images/icons/arrow_right.png)
![](../images/icons/arrow_down.png)
![method method](../images/icons/method.png)
setDestination(string $path) : \Zend_Form_Element_File
Set the upload destination
ParametersName | Type | Description |
---|
$path | string | |
---|
Returns ![](../images/icons/arrow_right.png)
![](../images/icons/arrow_down.png)
![method method](../images/icons/method.png)
setDisableTranslator(bool $flag) : \Zend_Form_Element_File
Indicate whether or not translation should be disabled
ParametersName | Type | Description |
---|
$flag | bool | |
---|
Returns ![](../images/icons/arrow_right.png)
![](../images/icons/arrow_down.png)
![method method](../images/icons/method.png)
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 ![](../images/icons/arrow_right.png)
![](../images/icons/arrow_down.png)
![method method](../images/icons/method.png)
setMaxFileSize(integer $size) : integer
Sets the maximum file size of the form
ParametersName | Type | Description |
---|
$size | integer | |
---|
Returns ![](../images/icons/arrow_right.png)
![](../images/icons/arrow_down.png)
![method method](../images/icons/method.png)
setMultiFile(integer $count) : \Zend_Form_Element_File
ParametersName | Type | Description |
---|
$count | integer | Number of file elements |
---|
Returns ![](../images/icons/arrow_right.png)
![](../images/icons/arrow_down.png)
![method method](../images/icons/method.png)
setValidators(array $validators) : \Zend_Form_Element_File
Add multiple validators at once, overwriting; proxy to adapter
ParametersName | Type | Description |
---|
$validators | array | |
---|
Returns ![](../images/icons/arrow_right.png)
![](../images/icons/arrow_down.png)
![method method](../images/icons/method.png)
setValue(mixed $value) : \Zend_Form_Element_File
Disallow setting the value
ParametersName | Type | Description |
---|
$value | mixed | |
---|
Returns ![](../images/icons/arrow_right.png)
![](../images/icons/arrow_down.png)
![method method](../images/icons/method.png)
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