Skip to content

Latest commit

 

History

History
19 lines (15 loc) · 460 Bytes

README.md

File metadata and controls

19 lines (15 loc) · 460 Bytes

UploadFileHelper

Usage example :

$uploadObject = new UtilFileUpload($_FILES['file']);

$uploadObject
    ->generateName()
    ->moveTo("/public/resource_folder/")
    ->acceptedExtensions(["png", "jpg", "jpeg", "pdf"])
    ->sizeLimit(10000000000)
    ->process();
    
 // If error : 
 if (count($uploadObject->getError()) > 0) {
    echo json_encode(array('success' => false, "message" => $uploadObject->getError()), JSON_PRETTY_PRINT);
}