PHPackages                             uploader/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. [Framework](/categories/framework)
4. /
5. uploader/uploader

ActiveLibrary[Framework](/categories/framework)

uploader/uploader
=================

Basic PHP library to upload files using different sources

v1.4.1(9y ago)870211MITPHPPHP &gt;=5.4.0

Since Mar 28Pushed 9y ago2 watchersCompare

[ Source](https://github.com/oscarotero/uploader)[ Packagist](https://packagist.org/packages/uploader/uploader)[ Docs](https://github.com/fol-project/fol)[ RSS](/packages/uploader-uploader/feed)WikiDiscussions master Synced today

READMEChangelog (7)Dependencies (1)Versions (8)Used By (1)

uploader
========

[](#uploader)

Basic php library to manage uploaded files

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/30b3c9ac4273c313191e99c10996fc653c6589d82ec78fa06b888bc07e1df2f6/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6f736361726f7465726f2f75706c6f616465722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/oscarotero/uploader/?branch=master)

Created by Oscar Otero

Basic usage
-----------

[](#basic-usage)

```
//Init a Uploader instance:
$uploader = new Uploader\Uploader('/base/path/to/uploads');

//Save an uploaded file:
$file = $uploader($_FILES['my-file']);

//Save a psr7 UploadedFileInterface instance
$file = $uploader($uploadedFile);

//Save a file from an url
$file = $uploader('http://example.com/files/file1.jpg');

//Save from base64 value
$file = $uploader('data:image/png;base64,...');
```

Advanced usage
--------------

[](#advanced-usage)

```
//Init a Uploader instance:
$uploader = new Uploader\Uploader('/base/path/to/uploads');

//Add some configuration
$uploader
	->setPrefix(function () {
		return uniqid();
	})
	->setDirectory('images');

//Assign an input
$imageUpload = $uploader->with($_FILES['my-image']);

//Save
$imageUpload->save();

//Get the relative path
echo $imageUpload->getDestination();
```

API
---

[](#api)

The following methods configure how the uploaded file will be saved

SetterGetterDescription`setPrefix(stringClosure)``getPrefix()``setOverwrite(booleanClosure)``getOverwrite()``setDestination(booleanClosure)``getDestination(bool $absolute = false)``setDirectory(stringClosure)``getDirectory()``setFilename(stringClosure)``getFilename()``setExtension(stringClosure)``getExtension()``setCwd(stringClosure)``getCwd()``setCreateDir(booleanClosure)``getCreateDir()`Example:

```
$uploader = new Uploader\Uploader(__DIR__.'/my-uploads');

$upload = $uploader
	->with($_FILES['my-file'])
	->setPrefix(uniqid())
	->setOverwrite(true)
	->setCreateDir(true)
	->setDirectory('files')
	->setExtension(function ($upload) {
		return strtolower($upload->getExtension());
	});

try {
	$upload->save();

	echo 'The file has been saved in '.$upload->getDestination();
} catch (Exception $e) {
	echo $e->getMessage();
}
```

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity63

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

Recently: every ~110 days

Total

7

Last Release

3648d ago

### Community

Maintainers

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

---

Top Contributors

[![oscarotero](https://avatars.githubusercontent.com/u/377873?v=4)](https://github.com/oscarotero "oscarotero (19 commits)")

---

Tags

framework

### Embed Badge

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

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

###  Alternatives

[symfony/symfony

The Symfony PHP framework

31.4k87.2M2.2k](/packages/symfony-symfony)[cakephp/cakephp

The CakePHP framework

8.9k19.5M1.8k](/packages/cakephp-cakephp)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[silverstripe/framework

The SilverStripe framework

7313.7M2.8k](/packages/silverstripe-framework)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)

PHPackages © 2026

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