Definition at line 42 of file uploader.php.
◆ __construct()
__construct |
( |
| $uploadDir, |
|
|
| $allowedMimeTypes, |
|
|
| $maxFileSize = 0, |
|
|
| $maxWidth = null, |
|
|
| $maxHeight = null ) |
Constructor
- Parameters
-
string | $uploadDir | |
array | $allowedMimeTypes | |
int | $maxFileSize | |
int | $maxWidth | |
int | $maxHeight | |
Definition at line 78 of file uploader.php.
◆ _checkStrict()
◆ _copyFile()
Copy the file to its destination
- Parameters
-
- Returns
- bool
Definition at line 306 of file uploader.php.
◆ checkExpectedMimeType()
checkExpectedMimeType |
( |
| ) |
|
Check whether or not the uploaded file type is allowed
- Returns
- bool
Definition at line 429 of file uploader.php.
◆ checkMaxFileSize()
Is the file the right size?
- Returns
- bool
Definition at line 328 of file uploader.php.
◆ checkMaxHeight()
Is the picture the right height?
- Returns
- bool
Definition at line 358 of file uploader.php.
◆ checkMaxWidth()
Is the picture the right width?
- Returns
- bool
Definition at line 338 of file uploader.php.
◆ checkMimeType()
Check whether or not the uploaded file type is allowed
- Returns
- bool
Definition at line 378 of file uploader.php.
◆ fetchMedia()
fetchMedia |
( |
| $media_name, |
|
|
| $index = null ) |
Fetch the uploaded file
- Parameters
-
string | $media_name | Name of the file field |
int | $index | Index of the file (if more than one uploaded under that name) |
- Returns
- bool
Definition at line 123 of file uploader.php.
◆ getErrors()
& getErrors |
( |
| $ashtml = true | ) |
|
Get generated errors
- Parameters
-
bool | $ashtml | Format using HTML? |
- Returns
- array|string Array of array messages OR HTML string
Definition at line 455 of file uploader.php.
◆ getMediaName()
Get the uploaded filename
- Returns
- string
Definition at line 205 of file uploader.php.
◆ getMediaSize()
Get the size of the uploaded file
- Returns
- int
Definition at line 225 of file uploader.php.
◆ getMediaTmpName()
Get the temporary name that the uploaded file was stored under
- Returns
- string
Definition at line 235 of file uploader.php.
◆ getMediaType()
Get the type of the uploaded file
- Returns
- string
Definition at line 215 of file uploader.php.
◆ getSavedDestination()
Get the destination the file is saved to
- Returns
- string
Definition at line 255 of file uploader.php.
◆ getSavedFileName()
Get the saved filename
- Returns
- string
Definition at line 245 of file uploader.php.
◆ setAllowedExtensions()
setAllowedExtensions |
( |
| $extensions | ) |
|
◆ setErrors()
◆ setPrefix()
◆ setStrictCheckExtensions()
setStrictCheckExtensions |
( |
| $extensions | ) |
|
◆ setTargetFileName()
setTargetFileName |
( |
| $value | ) |
|
Set the target filename
- Parameters
-
Definition at line 185 of file uploader.php.
◆ upload()
Check the file and copy it to the destination
- Parameters
-
- Returns
- bool
Definition at line 266 of file uploader.php.
◆ $_strictCheckExtensions
$_strictCheckExtensions = [] |
◆ $allowedExtensions
◆ $allowedMimeTypes
◆ $allowUnknownTypes
$allowUnknownTypes = false |
Flag indicating if unrecognized mimetypes should be allowed (use with precaution ! may lead to security issues )
Definition at line 47 of file uploader.php.
◆ $errors
◆ $extensionToMime
◆ $maxFileSize
◆ $maxHeight
◆ $maxWidth
◆ $mediaError
◆ $mediaName
◆ $mediaRealType
◆ $mediaSize
◆ $mediaTmpName
◆ $mediaType
◆ $prefix
◆ $savedDestination
◆ $savedFileName
◆ $targetFileName
◆ $uploadDir
The documentation for this class was generated from the following file: