PHPackages                             iamdual/uploader - 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. iamdual/uploader

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

iamdual/uploader
================

Safe, simple and useful file upload class for PHP.

v0.2.11(3y ago)112.7k51Apache-2.0PHPPHP &gt;=5.4.0CI failing

Since Jan 22Pushed 3y ago3 watchersCompare

[ Source](https://github.com/iamdual/uploader)[ Packagist](https://packagist.org/packages/iamdual/uploader)[ Docs](https://github.com/iamdual/uploader)[ RSS](/packages/iamdual-uploader/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (9)Dependencies (1)Versions (11)Used By (1)

### Uploader 🚀

[](#uploader-)

Safe, simple and useful file upload class for PHP 5.4+

### Installing

[](#installing)

```
composer require iamdual/uploader "^0.2.0"

```

### Examples

[](#examples)

Basic:

```
use iamdual\Uploader;

if (isset($_FILES["file"])) {

    $upload = new Uploader($_FILES["file"]);
    $upload->allowed_extensions(array("png", "jpg", "jpeg", "gif"));
    $upload->max_size(5); // in MB
    $upload->path("upload/files");
    $upload->name("foo");

    if (! $upload->upload()) {
        echo "Upload error: " . $upload->get_error();
    } else {
        echo "Upload successful!";
    }
}
```

Inline using:

```
use iamdual\Uploader;

if (isset($_FILES["file"])) {
    $upload = (new Uploader($_FILES["file"]))->max_size(20)->path("upload/files")->encrypt_name();

    if (! $upload->upload()) {
        echo "Upload error: " . $upload->get_error();
    } else {
        echo "Upload successful!";
    }
}
```

More examples in the "[examples](/examples)" directory.

### Methods

[](#methods)

NameDescription`allowed_extensions(array $extensions)`Allowed file extensions (example: png, gif, jpg)`disallowed_extensions(array $extensions)`Disallowed file extensions (example: html, php, dmg)`allowed_types(array $types)`Allowed mime types (example: image/png, image/jpeg)`disallowed_types(array $types)`Disallowed mime types`max_size(int $size)`Maximum file size (as MB)`min_size(int $size)`Minimum file size (as MB)`override()`Override the file with the same name`path(string $path)`Set the path where files will be uploaded`name(string $name)`Rename the uploaded file (example: foo)`encrypt_name()`Encrypt file name to hide the original name`must_be_image()`Check the file is image`max_dimensions(int $width, int $height)`Maximum image dimensions`min_dimensions(int $width, int $height)`Minimum image dimensions`aspect_ratios(array $aspect_ratios)`Image aspect ratios that has to be (example: 1:1, 4:3, 16:9)`error_messages(array $errors)`Custom error messagesNameDescriptionReturn`upload()`Upload the file and return output of the check()boolean`check()`Check the file can be uploadedboolean`get_name()`Get the uploaded file namestring`get_path()`Get the uploaded file name with full pathstring`get_tmp_name()`Get the temporary file pathstring`get_size()`Get the uploaded file size in bytesstring`get_type()`Get the uploaded file mime typestring`get_data_url()`Get the file as base64 encoded data URLstring`get_error()`Get error message if an error occurredstring### Notes

[](#notes)

`exif` and `fileinfo` extensions must be enabled.

### Contributes

[](#contributes)

Please send pull request or open an issue if you have the feature you want.

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 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 ~159 days

Recently: every ~174 days

Total

9

Last Release

1431d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1b4a4e761ecae5e00e3e247c7be0d4a7b63ae93145fd985b57b25078dbd892b8?d=identicon)[iamdual](/maintainers/iamdual)

---

Top Contributors

[![iamdual](https://avatars.githubusercontent.com/u/3048763?v=4)](https://github.com/iamdual "iamdual (42 commits)")

---

Tags

phpuploaduploader

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/iamdual-uploader/health.svg)

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

###  Alternatives

[venveo/craft-compress

Create smart zip files from Craft assets on the fly

124.7k](/packages/venveo-craft-compress)

PHPackages © 2026

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