1. Go to this page and download the library: Download sands/uploadable library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?phprequire_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
protected $uploadableConfig = [
// handle <input type="file" name="images"/> or <input type="file" name="images[]" multiple/>'images' => [
'fix-image-orientation', // fixes the image orientation'save', // saves the image prefixed wth "original-"'resize-image:800', // resize the image to 800px width, maintain aspect ratio'save:medium', // saves the image prefixed with "medium-"'resize-image:400', // resize the image to 400px width, maintain aspect ratio'save:small', // saves the image prefixed with "small-"'thumbnail-image:140', // creates a 140px x 140px thumbnail of the image, resized then center cropped'save:thumbnail', // saves the image prefixed with "thumbnail-"
],
// handle <input type="file" name="images[main]"/> use 'dot' notation'images.main' => [
...
],
];