Introduction
Providing some functions for uploading/validating files
How to use
You can load Upload class through Application::getClass method.
Controller
$upload = $this->getClass('Tool/Upload');
$upload->upload('file');
Methods
📄️ Upload::setUploadDir
Set upload directory
📄️ Upload::getUploadDir
Get upload directory
📄️ Upload::setMaxFileSize
Set upload file size limitation
📄️ Upload::getMaxFileSize
Get upload file size limitation
📄️ Upload::setFileType
Set upload file type limitation
📄️ Upload::getFileType
Get upload file type limitation
📄️ Upload::setUploadInfo
Set upload option once
📄️ Upload::upload
Validate uploaded file and move to upload directory
📄️ Upload::getUploadedData
Get uploaded file information
📄️ Upload::isError
Check uploaded file has error
📄️ Upload::getErrorMessage
Get uploaded file error