Class Upload_Validator
Methods summary
public
array
|
|
public
|
|
public
integer
|
#
getAllowedMaxFileSize( string $ext = null )
Get maximum file size for all or specified file extension. |
public
|
#
setAllowedMaxFileSize( array|integer $rules )
Set filesize maximums (in bytes). Automatically converts extensions to lowercase for easier matching. |
public
array
|
|
public
|
|
public
boolean
|
#
isValidSize( )
Determines if the bytesize of an uploaded file is valid - can be defined on an extension-by-extension basis in {$allowedMaxFileSize} |
public
boolean
|
#
isValidExtension( )
Determines if the temporary file has a valid extension An empty string in the validation map indicates files without an extension. |
public
boolean
|
#
validate( )
Run through the rules for this validator checking against the temporary file
set by |
Magic methods summary
Properties summary
protected
array
|
$tmpFile |
#
Information about the temporary file produced by the PHP-runtime. |
protected
array
|
$errors | |
public
array
|
$allowedMaxFileSize |
#
Restrict filesize for either all filetypes or a specific extension, with extension-name as array-key and the size-restriction in bytes as array-value. |
public
array
|
$allowedExtensions |
#
Collection of extensions. Extension-names are treated case-insensitive. Example: array("jpg","GIF") |