672.1. Zend\Validator\File\Upload
Validator for the maximum size of a file up to a max of 2GB
672.1.1. Methods
672.1.1.1. __construct
-
__construct()
Sets validator options
The array $files must be given in syntax of Zend_File_Transfer to be checked
If no files are given the $_FILES array will be used automatically.
NOTE: This validator will only work with HTTP POST uploads!
Parameters: | array|Traversable – Array of files in syntax of ZendFileTransferTransfer |
672.1.1.2. getFiles
-
getFiles()
Returns the array of set files
Parameters: | string – (Optional) The file to return in detail |
Return type: | array |
Throws : | ExceptionInvalidArgumentException If file is not found |
672.1.1.3. setFiles
-
setFiles()
Sets the files to be checked
Parameters: | array – The files to check in syntax of ZendFileTransferTransfer |
Return type: | Upload Provides a fluent interface |
672.1.1.4. isValid
-
isValid()
Returns true if and only if the file was uploaded without errors
Parameters: |
- string – Single file to check for upload errors, when giving null the $_FILES array
from initialization will be used
- mixed –
|
Return type: | bool
|
672.1.1.5. throwError
-
throwError()
Throws an error of the given type
Parameters: |
|
Return type: | false
|
672.1.2. Constants
672.1.2.1. INI_SIZE
@const string Error constants
672.1.2.2. FORM_SIZE
672.1.2.3. PARTIAL
672.1.2.4. NO_FILE
672.1.2.5. NO_TMP_DIR
672.1.2.6. CANT_WRITE
672.1.2.7. EXTENSION
672.1.2.8. ATTACK
672.1.2.9. FILE_NOT_FOUND
672.1.2.10. UNKNOWN