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.
Validator for the maximum size of a file up to a max of 2GB
TOO_BIG = 'fileSizeTooBig'
TOO_SMALL = 'fileSizeTooSmall'
NOT_FOUND = 'fileSizeNotFound'
integer|null $_max = ''
Maximum filesize
If null, there is no maximum filesize
array $_messageTemplates = 'array'
array $_messageVariables = 'array'
integer $_min = ''
Minimum filesize
integer $_size = ''
Detected size
boolean $_useByteString = 'true'
Use bytestring ?
__construct(
integer|array $options
)
:
Sets validator options
If $options is a integer, it will be used as maximum filesize As Array is accepts the following keys: 'min': Minimum filesize 'max': Maximum filesize 'bytestring': Use bytestring or real size for messages
_fromByteString(
string $size
)
:
integer
Returns the unformatted size
_getSize(
)
:
int
Retrieve current detected file size
_setSize(
int $size
)
:
Zend_Validate_File_Size
Set current size
_throw(
string $file, string $errorType
)
:
false
Throws an error of the given type
_toByteString(
integer $size
)
:
string
Returns the formatted size
getMax(
bool $raw
=
false
)
:
integer|string
Returns the maximum filesize
getMin(
bool $raw
=
false
)
:
integer|string
Returns the minimum filesize
isValid(
string $value, array $file
=
null
)
:
boolean
Defined by Zend_Validate_Interface
Returns true if and only if the filesize of $value is at least min and not bigger than max (when max is not null).
setMax(
integer $max
)
:
Zend_Validate_StringLength
Sets the maximum filesize
setMin(
integer $min
)
:
Zend_Validate_File_Size
Sets the minimum filesize
setUseByteString(
boolean $byteString
=
true
)
:
integer
Returns the minimum filesize
useByteString(
)
:
boolean
Will bytestring be used?