PHPackages                             lodev09/php-upload - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. lodev09/php-upload

ActiveLibrary[File &amp; Storage](/categories/file-storage)

lodev09/php-upload
==================

A very simple yet useful helper class to handle PHP file uploads.

2.0.2(5y ago)36.0k↓33.3%5MITPHPPHP &gt;=7.2

Since Feb 3Pushed 5y ago2 watchersCompare

[ Source](https://github.com/lodev09/php-upload)[ Packagist](https://packagist.org/packages/lodev09/php-upload)[ Docs](https://github.com/lodev09/php-upload)[ RSS](/packages/lodev09-php-upload/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (9)Used By (0)

PHP FileUpload Class
====================

[](#php-fileupload-class)

A very simple yet useful helper class to handle PHP file uploads.

Features
--------

[](#features)

- Supports Multiple file uploads
- Supports Exif for images
- Built-in and Custom validations
- Simple implementation
- or you can ask for more ...

Installation
------------

[](#installation)

```
$ composer require lodev09/php-upload

```

Usage
-----

[](#usage)

### HTML

[](#html)

```

```

### PHP (server side)

[](#php-server-side)

```
use \Upload\Upload;

if (isset($_FILES['files'])) {
    $validations = array(
        'category' => array('document', 'image', 'video'), // validate only those files within this list
        'size' => 20 // maximum of 20mb
    );

    // create new instance
    $upload = new Upload($_FILES['files'], $validations);

    // for each file
    foreach ($upload->files as $file) {
        if ($file->validate()) {
            // do your thing on this file ...
            // ...
            // say we don't allow audio files
            if ($file->is('audio')) $error = 'Audio not allowed';
            else {
                // then get base64 encoded string to do something else ...
                $filedata = $file->get_base64();

                // or get the GPS info ...
                $gps = $file->get_exif_gps();

                // then we move it to 'path/to/my/uploads'
                $result = $file->put('path/to/my/uploads');
                $error = $result ? '' : 'Error moving file';
            }

        } else {
            // oopps!
            $error = $file->get_error();
        }

        echo $file->name.' - '.($error ? ' [FAILED] '.$error : ' Succeeded!');
        echo '';
    }
}

?>
```

Feedback
--------

[](#feedback)

All bugs, feature requests, pull requests, feedback, etc., are welcome. Visit my site at [www.lodev09.com](http://www.lodev09.com "www.lodev09.com") or email me at

Credits
-------

[](#credits)

© 2018 - Coded by Jovanni Lo / [@lodev09](http://twitter.com/lodev09)

License
-------

[](#license)

Released under the [MIT License](http://opensource.org/licenses/MIT). See [LICENSE](LICENSE) file.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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.

###  Release Activity

Cadence

Every ~109 days

Recently: every ~191 days

Total

8

Last Release

1895d ago

Major Versions

1.1.0 → 2.0.02021-03-07

PHP version history (2 changes)1.0PHP &gt;=5.4

2.0.0PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/ae268d2ab8c40027a0734990564c4147625c4df62e053d03c2e87ef43fcd545c?d=identicon)[lodev09](/maintainers/lodev09)

---

Top Contributors

[![lodev09](https://avatars.githubusercontent.com/u/6686328?v=4)](https://github.com/lodev09 "lodev09 (15 commits)")

---

Tags

phpclassfilesuploadsphp upload

### Embed Badge

![Health badge](/badges/lodev09-php-upload/health.svg)

```
[![Health](https://phpackages.com/badges/lodev09-php-upload/health.svg)](https://phpackages.com/packages/lodev09-php-upload)
```

###  Alternatives

[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.6k263.6M790](/packages/league-flysystem-aws-s3-v3)

PHPackages © 2026

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