NextDom\Helpers\Utils::readUploadedFile
Checks and moves uploaded to given directory
Signature
public function readUploadedFile(array
$files,
string
$key,
string
$destDir,
int
$maxSizeMB,
array
$extensions,
[string
$cleaner = NULL] )
Parameters
$files
—
array
- variable like $_FILES
$key
—
string
- file name key in $_FILES
$destDir
—
string
- destination directory
$maxSizeMB
—
int
- maximum size of file in megabytes
$extensions
—
array
- list of accepted file extensions, ex: [ ".gz" ]. Any when empty
$cleaner
—
string
- function that returns the filename from $_FILES[$key]
Returns
- string
- path to modes file
Errors/Exceptions
-
CoreException
- when checks fail