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

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

baki/uploader
=============

Uploader class for all files

022PHP

Since Nov 9Pushed 5y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Instruction
===========

[](#instruction)

This package is for upload any type of file

For install type this command

```
composer require baki/uploader

```

After installation, on the page where you use the package you need to insert this part of the code

```
use Baki\Uploader;

```

Example
-------

[](#example)

Add the input:

```
 // for single file
 // for multiple files

```

In the php file, first instantiate the Uploader class

```
$file = new Uploader($request, 'your_name_input'); // $request must be instance of Illuminate\Http\Request

```

There are 2 optional arguments in this class. Delimiter and random name.

Delimiter means that all spaces will be replaced with that argument. The default is '-'.

Random name (bool) represents whether the file name will have random characters. The default is 0.

##### Exaple:

[](#exaple)

```
$file = new Uploader($request, 'your_name_input', '_', 1);
For multiple files on save it return like
[
    "SlReKKT0_xSMByfiU_josh_wilburne_147469_unsplash.jpg",
    "H8rBfHmB_0UE4bag3_photo_1537411809_5959db7f925d.jpg",
    "hEX1J3dy_x7UleULw_photo_1537408621655_3034354224c4.jpg"
]
-------------------------------------------------------------------------------------
For single file on save it return like "SlReKKT0_xSMByfiU_josh_wilburne_147469_unsplash.jpg"

```

Next set the allowed mime types for file \[OPTIONAL\] (e.g. for image)

```
$file->setMimeType('image/png', 'image/jpg', 'image/jpeg');
or
$file->setMimeType('image'); // All type of image pass the validation

```

If you do not call this method, you can upload any file. Then there is no validation for the file type Next set the file max size for upload (The number is in megabytes)

```
$file->setFileMaxSize(20); // the maximum file size to upload is 20MB

```

Next set the save path for file

```
$path = '/var/www/sites/domain.com/project/banners; // this is example
$file->setSavePath($path);

```

On finish call method save for save image on path. This method return the name of file

```
$file->save();

```

##### This method for single file return like

[](#this-method-for-single-file-return-like)

```
    "josh-wilburne-147469-unsplash.jpg"

```

##### This method for multiple files return like

[](#this-method-for-multiple-files-return-like)

```
[
    "josh-wilburne-147469-unsplash.jpg",
    "garin-chadwick-sLxQaYfnD20-unsplash.jpg",
    "chewy-8S0cSJ1Dy9Q-unsplash.jpg"
]

```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity31

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/9e893ad5d688f522745b4def59edf658bc65d19cdbb8094911da476acd1268b1?d=identicon)[baki1995](/maintainers/baki1995)

---

Top Contributors

[![Baki995](https://avatars.githubusercontent.com/u/118567196?v=4)](https://github.com/Baki995 "Baki995 (21 commits)")

### Embed Badge

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

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

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

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

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15161.6M2.6k](/packages/illuminate-filesystem)[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)[madnest/madzipper

Easier zip file handling for Laravel applications.

1382.3M6](/packages/madnest-madzipper)

PHPackages © 2026

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