PHPackages                             learncodeweb/filesupload - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. learncodeweb/filesupload

ActiveGd-image-processing[Image &amp; Media](/categories/media)

learncodeweb/filesupload
========================

A very simple (GD library Image processing) class for upload multiple files. You can create multiple thumbnails, add watermark (text/image), resize and change the quality of the images. You can also use this class with any PHP framework, tested with Laravel 8 and Laravel 9.

41001PHP

Since Sep 17Pushed 1y ago1 watchersCompare

[ Source](https://github.com/LearnCodeWeb/multi-files-upload-and-image-resizer)[ Packagist](https://packagist.org/packages/learncodeweb/filesupload)[ RSS](/packages/learncodeweb-filesupload/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)DependenciesVersions (2)Used By (0)

Multi files uploader &amp; image resizer
========================================

[](#multi-files-uploader--image-resizer)

A PHP base class that you can use to upload any file into the server. It is a very lightweight class and highly customizable. You can use this class with any framework or with core PHP.

[![GitHub](https://camo.githubusercontent.com/54d4cee740ab5cc40c4113a7d4e2a61b3dd4955cdedba7efbbf44e321cd64914/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6c6561726e636f64657765622f6d756c74692d66696c65732d75706c6f61642d616e642d696d6167652d726573697a65723f6c6162656c3d4c6963656e7365)](https://camo.githubusercontent.com/54d4cee740ab5cc40c4113a7d4e2a61b3dd4955cdedba7efbbf44e321cd64914/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6c6561726e636f64657765622f6d756c74692d66696c65732d75706c6f61642d616e642d696d6167652d726573697a65723f6c6162656c3d4c6963656e7365)[![GitHub file size in bytes](https://camo.githubusercontent.com/6761a8c43d6bfebc653a6abafbf75876ad10b98656017daa5fd1a76a7e73a7c2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73697a652f6c6561726e636f64657765622f6d756c74692d66696c65732d75706c6f61642d616e642d696d6167652d726573697a65722f7372632f46696c657355706c6f6164416e64496d616765526573697a652e7068703f6c6162656c3d4d61696e253230436c61737325323046696c6525323053697a65)](https://camo.githubusercontent.com/6761a8c43d6bfebc653a6abafbf75876ad10b98656017daa5fd1a76a7e73a7c2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73697a652f6c6561726e636f64657765622f6d756c74692d66696c65732d75706c6f61642d616e642d696d6167652d726573697a65722f7372632f46696c657355706c6f6164416e64496d616765526573697a652e7068703f6c6162656c3d4d61696e253230436c61737325323046696c6525323053697a65)[![Packagist Downloads](https://camo.githubusercontent.com/dc516daef0c0f8a08c40a5e2af298c6819217d0324c5578177c2ef4ffb663744/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c6561726e636f64657765622f66696c657375706c6f61643f6c6162656c3d436f6d706f736572253230496e7374616c6c)](https://camo.githubusercontent.com/dc516daef0c0f8a08c40a5e2af298c6819217d0324c5578177c2ef4ffb663744/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c6561726e636f64657765622f66696c657375706c6f61643f6c6162656c3d436f6d706f736572253230496e7374616c6c)[![GitHub repo size](https://camo.githubusercontent.com/b54c3e5927c6e215b4dccbbf608c5e53061baa353ae349dbbb8d10333e4da442/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7265706f2d73697a652f6c6561726e636f64657765622f6d756c74692d66696c65732d75706c6f61642d616e642d696d6167652d726573697a65723f6c6162656c3d546f74616c2532305265706f2e25323053697a65)](https://camo.githubusercontent.com/b54c3e5927c6e215b4dccbbf608c5e53061baa353ae349dbbb8d10333e4da442/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7265706f2d73697a652f6c6561726e636f64657765622f6d756c74692d66696c65732d75706c6f61642d616e642d696d6167652d726573697a65723f6c6162656c3d546f74616c2532305265706f2e25323053697a65)

[ ![Donate with love](https://camo.githubusercontent.com/1953df9115d3333597fe60076737a2433c17e710ddcb6039d18761a7c40114a5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f6e6174652d416464253230596f7572253230436f6e747269627574696f6e2d677265656e "Donate")](https://buy.stripe.com/cN2cN06fe2S1go0aEF)[ ![Donate with love](https://camo.githubusercontent.com/ece956a76872b8f12c8694388e0064bb662a07011e021b98a3700d5bb61c16fe/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f6e6174652d4275792532304c6561726e253230436f646525323057656225323061253230636f666665652d677265656e "Donate")](https://www.buymeacoffee.com/MG1mNqy)

Dependencies:
-------------

[](#dependencies)

This class is based on the GD library for image processing. If you don’t have this library install it or enable it in php.ini. To install the GD library use the below command.

```
sudo apt-get install php-gd

```

After installation makes sure you have a gd.ini file then open the php.ini file and find it below.

```
;extension=gd

```

Remove the comment \[ **;** \] and change it to below.

```
extension=gd

```

---

Composer installation:
----------------------

[](#composer-installation)

```
composer require learncodeweb/filesupload:dev-main

```

After installation recreates the autoload file with the help of the below command.

```
composer dump-autoload

```

---

How to import into the project:
-------------------------------

[](#how-to-import-into-the-project)

In laravel 8+ (Tested)

```
use anyFileUpload\FilesUploadAndImageResize as anyFilesUpload;

$files = new anyFilesUpload('array', ['jpg', 'jpeg', 'png'], public_path('uploads'), 0777);
$files->uploadFiles('files', 250, [], '', 100, '850', ['350']);

dd($files->uploadedData);
```

In core PHP just add the autoload.php file to your project like below.

```
required('.../vendor/autoload.php');
$upload    =    new anyFileUpload\ImageUploadAndResize('array', ['jpeg', 'jpg', 'png'], '../uploads', 0655);
$upload->uploadFiles('files', 250, '', $rename, 100, '850', ['350','450']);
```

Class option &amp; features:
----------------------------

[](#class-option--features)

A PHP base class that you can use to upload any file into the server. It is a very lightweight class and highly customizable. You can use this class with any framework or with core PHP.

1. Upload Single Or Multiple Files.
2. Upload Any Type Of Files (Not Only Images).
3. The image file can Resize.
4. Create Image Thumbnails (With Keep The Image Aspect Ratio).
5. You can add a watermark (Text, Image).
6. Easy Integration With Forms.
7. Create Any Number Of Thumbnails Under One Upload.
8. Customizable Paths To Thumbnails Folders.
9. Customizable Thumbnails Sizes And Dimensions.
10. Files Extension Filters.
11. File Size Limit for Uploading.

All parameters that you need to set in the constructor
------------------------------------------------------

[](#all-parameters-that-you-need-to-set-in-the-constructor)

ParametersDefault ValueDescriptionResponse formatarrayYou can set it to JSON or array.Allow extensionsNot setYou can set the file extensions in the array like \['jpg','PNG'\].Dir pathemptyFolder name where you need to save images \[‘../Upload/’\]. If you set the thumbs size array, the thumb folder will be created and thumb files move there.Dir permission0655You can set the permission of the newly created Dir.All parameters that you need to set in the method
-------------------------------------------------

[](#all-parameters-that-you-need-to-set-in-the-method)

ParametersDefault ValueDescriptionInput index nameUser setYou can set your input="file" name should be an array like name="yourIndexName\[\]".Check minimum width400Default min width is 400, you can change with any number.WatermarkemptyYou can set the watermark array to see the below details.Re-nameemptyRename the uploaded file if you need it. Left empty get system created default name.Image Quality100Image quality in percent 1-100. Apply only for images (jpg,jpeg,png,gif).New WidthemptyIf you want to resize the image then pass int value else upload without resizing the image will be saved.Thumb WidthsemptyIf you want to create multiple thumbs then pass int value with array \[350,450\].---

How to use with direct access:
------------------------------

[](#how-to-use-with-direct-access)

```
require('../FilesUploadAndImageResize.php'); // File direct access
$rename    =    rand(1000, 5000) . time(); // left empty if you want the real file name
$upload    =    new anyFileUpload\ImageUploadAndResize('array', ['jpeg', 'jpg', 'png'], '../uploads', 0655);
$upload->uploadFiles('files', 250, '', $rename, 100, '850', ['350','450']);
```

For watermark you will use an array and be able to add the image as a watermark or text.
----------------------------------------------------------------------------------------

[](#for-watermark-you-will-use-an-array-and-be-able-to-add-the-image-as-a-watermark-or-text)

> With text below will be the parameters:

```
[
    'value' => "HI I AM ZAID",
    'font-size' => 50,
    'font-family' => "../fonts/Myriad-Pro-Regular.ttf",
    'font-color' => '#0a103e',
    'position-x' => 400,
    'position-y' => 100
];
```

> With the image below will be the parameters:

```
[
    'value' => "your-image-complete-path",
    'position-x' => 400,
    'position-y' => 100
];
```

The response will get like the below:
-------------------------------------

[](#the-response-will-get-like-the-below)

In the below response, you will get the uploaded/not uploaded/bad extensions and success/error flags array or JSON data.

```
print "";
print_r($upload->uploadedData);
print "";
```

Upload file size change on the server
-------------------------------------

[](#upload-file-size-change-on-the-server)

There is a possibility the upload file size is not set on a server, the default 2MB value is set on a server. If you face this type of issue just find the right path of your php.ini file and change the bleow two parameters.

```
upload_max_filesize = 2M
post_max_size = 8M

```

Change to below.

```
upload_max_filesize = 100M
post_max_size = 150M

```

### Remember:

[](#remember)

post max size should be greater than upload max filesize.

[ ![Donate with love](https://camo.githubusercontent.com/1953df9115d3333597fe60076737a2433c17e710ddcb6039d18761a7c40114a5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f6e6174652d416464253230596f7572253230436f6e747269627574696f6e2d677265656e "Donate")](https://buy.stripe.com/cN2cN06fe2S1go0aEF)[ ![Donate with love](https://camo.githubusercontent.com/ece956a76872b8f12c8694388e0064bb662a07011e021b98a3700d5bb61c16fe/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f6e6174652d4275792532304c6561726e253230436f646525323057656225323061253230636f666665652d677265656e "Donate")](https://www.buymeacoffee.com/MG1mNqy)

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity19

Early-stage or recently created project

 Bus Factor1

Top contributor holds 98.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e5289415fd5a72ae58300e7af61456d38bfc0d8e54a569a6bb198a9daad01fd5?d=identicon)[Mian Zaid](/maintainers/Mian%20Zaid)

---

Top Contributors

[![mianzaid](https://avatars.githubusercontent.com/u/9605800?v=4)](https://github.com/mianzaid "mianzaid (84 commits)")[![mzbk](https://avatars.githubusercontent.com/u/98791485?v=4)](https://github.com/mzbk "mzbk (1 commits)")

### Embed Badge

![Health badge](/badges/learncodeweb-filesupload/health.svg)

```
[![Health](https://phpackages.com/badges/learncodeweb-filesupload/health.svg)](https://phpackages.com/packages/learncodeweb-filesupload)
```

###  Alternatives

[milon/barcode

Barcode generator like Qr Code, PDF417, C39, C39+, C39E, C39E+, C93, S25, S25+, I25, I25+, C128, C128A, C128B, C128C, 2-Digits UPC-Based Extention, 5-Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI (Variation of Plessey code)

1.5k13.3M39](/packages/milon-barcode)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k23](/packages/bkwld-croppa)[goat1000/svggraph

Generates SVG graphs

132849.6k3](/packages/goat1000-svggraph)[cohensive/embed

Media Embed (for Laravel or as a standalone).

120370.4k](/packages/cohensive-embed)[netresearch/rte-ckeditor-image

Image support in CKEditor for the TYPO3 ecosystem - by Netresearch

63991.3k4](/packages/netresearch-rte-ckeditor-image)[humanmade/tachyon-plugin

Rewrites WordPress image URLs to use Tachyon

87338.5k2](/packages/humanmade-tachyon-plugin)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
