PHPackages                             karelwintersky/arris.php-file-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. karelwintersky/arris.php-file-upload

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

karelwintersky/arris.php-file-upload
====================================

A library to help with uploading files in PHP

0.2.1(1y ago)09[1 issues](https://github.com/ArrisFramework/Arris.PHP_FileUpload/issues)MITPHPPHP &gt;=7.4 | 8.\*

Since Aug 11Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ArrisFramework/Arris.PHP_FileUpload)[ Packagist](https://packagist.org/packages/karelwintersky/arris.php-file-upload)[ RSS](/packages/karelwintersky-arrisphp-file-upload/feed)WikiDiscussions master Synced 1mo ago

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

### Uploader 🚀

[](#uploader-)

Safe, simple and useful file upload class

### Installing

[](#installing)

```
composer require karelwintersky/arris.php-file-upload

```

### Examples

[](#examples)

Basic:

```
use Arris\Toolkit\FileUpload;

if (isset($_FILES["file"])) {
    $upload = new FileUpload($_FILES["file"]);
    $upload->setAllowedExtensions(array("png", "jpg", "jpeg", "gif"));
    $upload->setMaxSize(5); // in MB
    $upload->setPath("upload/files");
    $upload->setName("foo");

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

Inline using:

```
use Arris\Toolkit\FileUpload;

if (isset($_FILES["file"])) {
    $upload = (new FileUpload($_FILES["file"]))->setMaxSize(20)->setPath("upload/files")->encrypt_name();

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

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

### Methods

[](#methods)

NameDescription`setAllowedExtensions(array $extensions)`Allowed file extensions (example: png, gif, jpg)`setDisallowedExtensions(array $extensions)`Disallowed file extensions (example: html, php, dmg)`setAllowedTypes(array $types)`Allowed mime types (example: image/png, image/jpeg)`setDisallowedTypes(array $types)`Disallowed mime types`setMaxSize(int $size)`Maximum file size (as MB)`setMinSize(int $size)`Minimum file size (as MB)`override()`Override the file with the same name`setPath(string $path)`Set the path where files will be uploaded`setName(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`setMaxDimensions(int $width, int $height)`Maximum image dimensions`setMinDimensions(int $width, int $height)`Minimum image dimensions`setAspectRatios(array $aspect_ratios)`Image aspect ratios that has to be (example: 1:1, 4:3, 16:9)`setErrorMessages(array $errors)`Custom error messages`getUploadedFiles()`Converts input array ($\_FILES) to more usable formNameDescriptionReturn`upload()`Upload the file and return output of the check()boolean`check()`Check the file can be uploadedboolean`getName()`Get the uploaded file namestring`getPath()`Get the uploaded file name with full pathstring`getTempName()`Get the temporary file pathstring`getSize()`Get the uploaded file size in bytesstring`getType()`Get the uploaded file mime typestring`getDataURL()`Get the file as base64 encoded data URLstring`getError()`Get error message if an error occurredstring### Notes

[](#notes)

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

Based on

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

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

Total

3

Last Release

637d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2164874?v=4)[Karel Wintersky](/maintainers/KarelWintersky)[@KarelWintersky](https://github.com/KarelWintersky)

---

Top Contributors

[![KarelWintersky](https://avatars.githubusercontent.com/u/2164874?v=4)](https://github.com/KarelWintersky "KarelWintersky (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/karelwintersky-arrisphp-file-upload/health.svg)

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

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34390.8M124](/packages/google-cloud-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)

PHPackages © 2026

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