Upload
This is one function that uploads and validates files, crop/resize images among other features.
Parameters
Parameter
Required
Type
Description
$file
Yes
string
This could be a url path to a file, base64 image or $_FILES from a form.
$storage
No
string
The folder inside /uploads
to save the uploaded file. default is general
$options
No
array
Explained on the table below.
$options explanation
Key
Type
Description
source
string
Define the source of your file ( form | base64 | url ) Default if form.
extension
string
The extension(png, pdf, .....) of your output, this is required if your source is url.
allowedExtensions
string
Allowed extension separated by a comma, the upload will fail if extension don't match.
resize
array
Pass this array if you are uploading an image you want to crop. Sample array on usage section below
crop
array
Pass this array you are uploading an image to resize. Sample array of the usage section below
Usage
Response
Last updated