PHPackages                             siriusphp/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. [HTTP &amp; Networking](/categories/http)
4. /
5. siriusphp/upload

ActiveLibrary[HTTP &amp; Networking](/categories/http)

siriusphp/upload
================

Framework agnostic upload library

4.0.0(2y ago)228591.9k↑88.2%257MITPHPPHP &gt;=8.1CI failing

Since Mar 23Pushed 2y ago11 watchersCompare

[ Source](https://github.com/siriusphp/upload)[ Packagist](https://packagist.org/packages/siriusphp/upload)[ RSS](/packages/siriusphp-upload/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (7)Versions (14)Used By (7)

Sirius\\Upload
==============

[](#siriusupload)

[![Source Code](https://camo.githubusercontent.com/3780e2bdad4e6cee4aa8ba95a3817ea259d3fec1c133ce616606815a2e7d8662/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f736f757263652d7369726975737068702f75706c6f61642d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/siriusphp/upload)[![Latest Version](https://camo.githubusercontent.com/9af5f9e1dd0cf873ceb8f78a5193d91e500fbd5ed7257220bbd82b4d1375cf37/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7369726975737068702f75706c6f61642e7376673f7374796c653d666c61742d737175617265)](https://github.com/siriusphp/upload/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/siriusphp/upload/blob/master/LICENSE)[![Build Status](https://github.com/siriusphp/upload/actions/workflows/ci.yml/badge.svg)](https://github.com/siriusphp/upload/actions/workflows/ci.yml)[![Coverage Status](https://camo.githubusercontent.com/4593da9a2afd66ab9ee4ee59c241b28bda3916bbae19242ea54584aec3d8d40d/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f7369726975737068702f75706c6f61642e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/siriusphp/upload/code-structure)[![Quality Score](https://camo.githubusercontent.com/706abb9fab14347ca7dcc4ed7ed7d62036b27ce64a285135978ca97cc2ce0eb4/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7369726975737068702f75706c6f61642e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/siriusphp/upload)[![Total Downloads](https://camo.githubusercontent.com/cd2eafd83455519d143c2700b1359f0063780629667380c01fa999ba0fbadf04/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7369726975737068702f75706c6f61642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/siriusphp/upload)

Framework agnostic upload handler library.

Features
--------

[](#features)

1. Validates files against usual rules: extension, file size, image size (wdith, height, ratio). It uses [Sirius Validation](https://github.com/siriusphp/validation) for this purpose.
2. Moves valid uploaded files into containers. Containers are usually local folders but you can implement your own or use other filesystem abstractions like [Gaufrette](https://github.com/KnpLabs/Gaufrette) or [Flysystem](https://github.com/FrenkyNet/Flysystem).
3. Works with PSR7 `UploadedFileInterface` objects and with Symfony's `UploadedFile`s (see [integrations](docs/integrations.md)).

Used by [Bolt CMS](https://bolt.cm/)

Elevator pitch
--------------

[](#elevator-pitch)

```
use Sirius\Upload\Handler as UploadHandler;
$uploadHandler = new UploadHandler('/path/to/local_folder');

// validation rules
$uploadHandler->addRule('extension', ['allowed' => ['jpg', 'jpeg', 'png']], '{label} should be a valid image (jpg, jpeg, png)', 'Profile picture');
$uploadHandler->addRule('size', ['max' => '20M'], '{label} should have less than {max}', 'Profile picture');

$result = $uploadHandler->process($_FILES['picture']); // ex: subdirectory/my_headshot.png

if ($result->isValid()) {
	// do something with the image like attaching it to a model etc
	try {
		$profile->picture = $result->name;
		$profile->save();
		$result->confirm(); // this will remove the .lock file
	} catch (\Exception $e) {
		// something wrong happened, we don't need the uploaded files anymore
		$result->clear();
		throw $e;
	}
} else {
	// image was not moved to the container, where are error messages
	$messages = $result->getMessages();
}
```

Links
-----

[](#links)

- [documentation](https://www.sirius.ro/php/sirius/upload/)
- [changelog](CHANGELOG.md)

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity54

Moderate usage in the ecosystem

Community31

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

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

###  Release Activity

Cadence

Every ~294 days

Recently: every ~697 days

Total

13

Last Release

958d ago

Major Versions

1.3.1 → 2.0.02015-05-17

2.1.1 → 3.0.02020-02-27

3.0.1 → 4.0.02023-11-19

PHP version history (4 changes)1.0.0PHP &gt;=5.4

1.2.1PHP &gt;=5.3

3.0.0PHP &gt;=7.1

4.0.0PHP &gt;=8.1

### Community

Maintainers

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

---

Top Contributors

[![adrianmiu](https://avatars.githubusercontent.com/u/1293017?v=4)](https://github.com/adrianmiu "adrianmiu (35 commits)")[![GwendolenLynch](https://avatars.githubusercontent.com/u/1427081?v=4)](https://github.com/GwendolenLynch "GwendolenLynch (7 commits)")[![ao2](https://avatars.githubusercontent.com/u/1249395?v=4)](https://github.com/ao2 "ao2 (5 commits)")[![yaayes](https://avatars.githubusercontent.com/u/20878658?v=4)](https://github.com/yaayes "yaayes (2 commits)")[![bobdenotter](https://avatars.githubusercontent.com/u/1833361?v=4)](https://github.com/bobdenotter "bobdenotter (1 commits)")[![JarJak](https://avatars.githubusercontent.com/u/4981490?v=4)](https://github.com/JarJak "JarJak (1 commits)")[![Moln](https://avatars.githubusercontent.com/u/2050694?v=4)](https://github.com/Moln "Moln (1 commits)")[![hybridvision](https://avatars.githubusercontent.com/u/11492432?v=4)](https://github.com/hybridvision "hybridvision (1 commits)")[![deining](https://avatars.githubusercontent.com/u/18169566?v=4)](https://github.com/deining "deining (1 commits)")

---

Tags

file-uploadformsphpuploadpsr-7validationsecurityfileuploadformfile-upload

###  Code Quality

TestsPest

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[delight-im/file-upload

Simple and convenient file uploads — secure by default

7310.9k2](/packages/delight-im-file-upload)[srio/rest-upload-bundle

Handle multiple rest upload ways

46126.4k](/packages/srio-rest-upload-bundle)[middlewares/firewall

Middleware to provide IP filtering

12320.3k2](/packages/middlewares-firewall)[middlewares/csp

Middleware to add the Content-Security-Policy header to the response

1524.0k](/packages/middlewares-csp)[middlewares/honeypot

Middleware to implement a honeypot spam prevention

142.6k](/packages/middlewares-honeypot)

PHPackages © 2026

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