PHPackages                             oldravian/multi-source-file-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. oldravian/multi-source-file-uploader

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

oldravian/multi-source-file-uploader
====================================

A Laravel package for handling file upload from multiple sources like file object, url or base64 encoded data

v1.0.0(3y ago)810.3k—0%MITPHPPHP ^7.2|^8.0

Since Mar 27Pushed 3y ago1 watchersCompare

[ Source](https://github.com/oldravian/multi-source-file-uploader)[ Packagist](https://packagist.org/packages/oldravian/multi-source-file-uploader)[ RSS](/packages/oldravian-multi-source-file-uploader/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Multi Source File Uploader
==========================

[](#multi-source-file-uploader)

> A Laravel package for handling file upload from multiple sources like file object, url or base64 encoded data

Current Features
----------------

[](#current-features)

- file uploading from multiple sources like file object, url or base64 encoded data
- file validation (based on extension and size)
- support for handling multiple files

Upcoming Features
-----------------

[](#upcoming-features)

- file compression
- support for file deletion

Requirements
------------

[](#requirements)

It is recommended to install this package with **PHP version 7.2+** and **Laravel Framework version 5.5+**

Installation
------------

[](#installation)

```
composer require oldravian/multi-source-file-uploader

```

Configuration
-------------

[](#configuration)

Copy configuration to your project:

```
php artisan vendor:publish --provider="OldRavian\FileUploader\FileUploaderServiceProvider"

```

By executing above command the package configuration will be published to **config/old-ravian-file-uploader.php**

Usage
-----

[](#usage)

Firstly, you need to initialize the specific FileUploader instance using `FileUploaderFactory`

```
$file_uploader_factory = new \OldRavian\FileUploader\Factories\FileUploaderFactory();
$file_uploader = $file_uploader_factory->build(here you need to provide the file source name, it could be "object", "url" or "base64");
```

Upload File From Object
-----------------------

[](#upload-file-from-object)

In your controller method:

```
public function uploadFile(Request $request)
{
  $uploadSettings = ["directory"=>"mention directory", "disk"=>"mention disk", "maxFileSize"=>"mention size in bytes", "allowedExtensions"=>[mention extensions]];
  $file_uploader_factory = new \OldRavian\FileUploader\Factories\FileUploaderFactory();
  $file_uploader = $file_uploader_factory->build("object");

  //first parameter should be an instance of \Illuminate\Http\UploadedFile
  //second parameter is optional, if you leave that parameter then default settings will be used
  $data = $file_uploader->upload($request->file, $uploadSettings); //it will return an array
}
```

**$uploadSettings** is an asociative array with the following possible keys:

- `directory`: the root directory containing your uploaded files
- `disk`: the storage disk for file upload. Check Laravel official documentation for more details, e.g: `public`, `s3`
- `maxFileSize` (in bytes): the maximum size of an uploaded file
- `allowedExtensions`: array of acceptable file extensions, e.g: `['jpg', 'png', 'pdf']`

The backend default settings are as follows:

```
- 'directory': 'media'
- 'disk': 'public'
- 'maxFileSize':  50 MB
- 'allowedExtensions': 'png','jpg','jpeg','mp4','doc','docx','ppt','pptx','xls','xlsx','txt','pdf'

```

You can change these default settings by using the following environment variables in .env:

- `OLDRAVIAN_File_UPLOADER_DEFAULT_DISK`
- `OLDRAVIAN_File_UPLOADER_DEFAULT_DIRECTORY`
- `OLDRAVIAN_File_UPLOADER_DEFAULT_MAX_FILE_SIZE` (in bytes)

If the upload succeeds,`$file_uploader->upload($request->file, $uploadSettings)` will return the following data for being further persisted to database:

```
[
    'filename' => 'uploaded file name',
    'path' => 'path to file location relative to the disk storage',
    'url' => 'public url to access the file in browser'
]
```

If the uploaded file is not valid, then `false` will be returned and an error message will be set for `$file_uploader->uploadError`

Upload File From URL
--------------------

[](#upload-file-from-url)

```
$file_uploader_factory = new \OldRavian\FileUploader\Factories\FileUploaderFactory();
$file_uploader = $file_uploader_factory->build("url");

//first parameter should be a string url
//second parameter is optional, if you leave that parameter then default settings will be used
$data = $file_uploader->upload($request->url, $uploadSettings);
```

Upload File From Base64 Encoded data
------------------------------------

[](#upload-file-from-base64-encoded-data)

```
$file_uploader_factory = new \OldRavian\FileUploader\Factories\FileUploaderFactory();
$file_uploader = $file_uploader_factory->build("base64");

//first parameter should be a string (base64 encoded string)
//second parameter is optional, if you leave that parameter then default settings will be used
$data = $file_uploader->upload($request->base64_str, $uploadSettings);
```

Handling Multiple File Uploads
------------------------------

[](#handling-multiple-file-uploads)

```
$file_uploader_factory = new \OldRavian\FileUploader\Factories\FileUploaderFactory();
$file_uploader = $file_uploader_factory->build("object or url or base64");

$urls_array = ["first file url", "second file url", "third file url"];
//first parameter should be an array (it could be an array of objects or urls or base64 encoded strings array based on what you mentioned in the above line)
//second parameter is optional, if you leave that parameter then default settings will be used
$data_array = $file_uploader->uploadMany($urls_array, $uploadSettings); //$data_array is a 2d array
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

Unknown

Total

1

Last Release

1149d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/176a7c75641b08b0ce95a9be1ad3d43997e4c0cc8c07038c4de0c7060ef735f2?d=identicon)[oldravian](/maintainers/oldravian)

---

Top Contributors

[![oldravian](https://avatars.githubusercontent.com/u/33361064?v=4)](https://github.com/oldravian "oldravian (6 commits)")

---

Tags

fileuploaderlaravellaravelpackagephplaravelfile-uploadmulti-source-file-uploadupload-file-from-urlupload-file-from-base64upload-file-from-file-object

### Embed Badge

![Health badge](/badges/oldravian-multi-source-file-uploader/health.svg)

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

###  Alternatives

[kingofcode/laravel-uploadable

Laravel Uploadable trait to automatically upload images and files with minimum configuration

286.4k](/packages/kingofcode-laravel-uploadable)[josefbehr/filament-spatie-media-library-croppie

A filament form field for image upload using spatie media library and croppie.js

126.6k](/packages/josefbehr-filament-spatie-media-library-croppie)[fojuth/plupload

A Laravel 4 implementation of Plupload (http://www.plupload.com/).

162.5k](/packages/fojuth-plupload)[menthe/aliyun-ueditor

UEditor for laravel5 and Aliyun OSS.Store all images and files in Aliyun OSS. Support i18n. UEditor is a Rich Text Web Editor From Baidu.

172.4k](/packages/menthe-aliyun-ueditor)

PHPackages © 2026

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