PHPackages                             coding-socks/laravel-chunk-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. coding-socks/laravel-chunk-uploader

Abandoned → [coding-socks/laravel-upload-handler](/?search=coding-socks%2Flaravel-upload-handler)Library[Utility &amp; Helpers](/categories/utility)

coding-socks/laravel-chunk-uploader
===================================

This package helps integrate a Laravel application with chunk uploader libraries eg. DropzoneJS and Resumable.js

v0.2.6(1y ago)11163[12 issues](https://github.com/coding-socks/laravel-upload-handler/issues)MITPHPPHP ^8.0CI failing

Since Nov 14Pushed 1y ago6 watchersCompare

[ Source](https://github.com/coding-socks/laravel-upload-handler)[ Packagist](https://packagist.org/packages/coding-socks/laravel-chunk-uploader)[ RSS](/packages/coding-socks-laravel-chunk-uploader/feed)WikiDiscussions main Synced yesterday

READMEChangelog (7)Dependencies (4)Versions (9)Used By (0)

Laravel Upload Handler
======================

[](#laravel-upload-handler)

Upload Handler Package For Laravel

[![Github Actions Badge](https://github.com/coding-socks/laravel-upload-handler/workflows/run-tests/badge.svg)](https://github.com/coding-socks/laravel-upload-handler/actions?query=workflow%3A%22run-tests%22)[![Downloads Badge](https://camo.githubusercontent.com/2ed13e41c0e3c80809b4e4c162068d503a2f5c2f6b6d0f18e30ee632c8d9692e/68747470733a2f2f706f7365722e707567782e6f72672f636f64696e672d736f636b732f6c61726176656c2d75706c6f61642d68616e646c65722f646f776e6c6f616473)](https://packagist.org/packages/coding-socks/laravel-upload-handler)[![Version Badge](https://camo.githubusercontent.com/dceddab5623ad0d2b64dcd336dcba9b8f7eadf110f3f4e40bcdc1cecbd03643f/68747470733a2f2f706f7365722e707567782e6f72672f636f64696e672d736f636b732f6c61726176656c2d75706c6f61642d68616e646c65722f76657273696f6e)](https://packagist.org/packages/coding-socks/laravel-upload-handler)[![Coverage Badge](https://camo.githubusercontent.com/a066ece0bf08e11ffcc1df32a5da8a25b42626736dc9ab1e25e4da248fde4d48/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f636f64696e672d736f636b732f6c61726176656c2d75706c6f61642d68616e646c65722f6261646765732f636f7665726167652e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/coding-socks/laravel-upload-handler/)[![License Badge](https://camo.githubusercontent.com/7a96494ca897251475cefa8738af1ee1909b376d1b64efdd7796c1700e465b01/68747470733a2f2f706f7365722e707567782e6f72672f636f64696e672d736f636b732f6c61726176656c2d75706c6f61642d68616e646c65722f6c6963656e7365)](https://packagist.org/packages/coding-socks/laravel-upload-handler)

This package helps integrate a Laravel application with chunk uploader libraries eg. [DropzoneJS](https://www.dropzonejs.com/) and [jQuery-File-Upload from blueimp](https://blueimp.github.io/jQuery-File-Upload/).

Uploading a large file in chunks can help reduce risks.

- PHP from 5.3.4 limits the number of concurrent uploads and by uploading a file in one request can limit the availability of a service. ([max\_file\_uploads](https://www.php.net/manual/en/ini.core.php#ini.max-file-uploads))
- For security reasons many systems limit the payload size, and the uploadable file size. PHP is not an exception. ([upload\_max\_filesize](https://www.php.net/manual/en/ini.core.php#ini.upload-max-filesize))
- It can be useful to check the meta information of a file and decline an upload upfront, so the user does not have to wait for minutes or seconds to upload a large file and then receive an error message for an invalid the file type or mime type.
- Can include resume functionality which means an upload can be continued after a reconnection.

However, there is not a single RFC about chunked uploads and this caused many implementations. The most mature project at the moment is [tus](https://tus.io/).

Similar projects:

- Multiple library support: [1up-lab/OneupUploaderBundle](https://github.com/1up-lab/OneupUploaderBundle), [pionl/laravel-chunk-upload](https://github.com/pionl/laravel-chunk-upload)
- Single library support: [ankitpokhrel/tus-php](https://github.com/ankitpokhrel/tus-php), [flowjs/flow-php-server](https://github.com/flowjs/flow-php-server), [jildertmiedema/laravel-plupload](https://github.com/jildertmiedema/laravel-plupload), [OneOffTech/laravel-tus-upload](https://github.com/OneOffTech/laravel-tus-upload)

Table of contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
    - [Requirements](#requirements)
- [Usage](#usage)
    - [Events](#events)
    - [Changing the driver](#changing-the-driver)
    - [Adding your own drivers](#adding-your-own-drivers)
- [Drivers](#drivers)
    - [Monolith](#monolith-driver)
    - [Blueimp](#blueimp-driver)
    - [DropzoneJS](#dropzonejs-driver)
    - [Flow.js](#flowjs-driver)
    - [ng-file-upload](#ng-file-upload-driver)
    - [Plupload](#plupload-driver)
    - [Resumable.js](#resumablejs-driver)
    - [simple-uploader.js](#simple-uploaderjs-driver)
- [Identifiers](#identifiers)
    - [Session identifier](#session-identifier)
    - [Auth identifier](#auth-identifier)
    - [NOP identifier](#nop-identifier)
- [Contribution](#contribution)
- [License](#license)

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

[](#installation)

You can easily install this package using Composer, by running the following command:

```
composer require coding-socks/laravel-upload-handler
```

### Requirements

[](#requirements)

This package has the following requirements:

- PHP `^7.3`
- Laravel `^6.10 || ^7.0 || ^8.0`

[Caret Version Range (^)](https://getcomposer.org/doc/articles/versions.md#caret-version-range-)

Usage
-----

[](#usage)

1. Register a route

```
Route::any('/my-route', 'MyController@myFunction');
```

2. Retrieve the upload handler. (The chunk upload handler can be retrieved from the container in two ways.)

- Using dependency injection

```
use Illuminate\Http\Request;
use CodingSocks\UploadHandler\UploadHandler;

class MyController extends Controller
{
    public function myFunction(Request $request, UploadHandler $handler)
    {
        return $handler->handle($request);
    }
}
```

- Resolving from the app container

```
use Illuminate\Http\Request;
use CodingSocks\UploadHandler\UploadHandler;

class MyController extends Controller
{
    public function myFunction(Request $request)
    {
        $handler = app()->make(UploadHandler::class);
        return $handler->handle($request);
    }
}
```

The handler exposes the following methods:

MethodDescription`handle`Handle the given request"Handle" is quite vague but there is a reason for that. This library tries to provide more functionality than just saving the uploaded chunks. It is also adds functionality for resumable uploads which depending on the client side library can differ very much.

### Events

[](#events)

Once a file upload finished a `\CodingSocks\UploadHandler\Event\FileUploaded` is triggered. This event contains the disk and the path of the uploaded file.

- [Laravel 7.x - Defining Listeners](https://laravel.com/docs/6.x/events#defining-listeners)
- [Laravel 7.x - Defining Listeners](https://laravel.com/docs/7.x/events#defining-listeners)
- [Laravel 8.x - Defining Listeners](https://laravel.com/docs/8.x/events#defining-listeners)

You can also add a `Closure` as the second parameter of the `handle` method to add an inline listener. The listener is called with the disk and the path of the uploaded file.

```
$handler->handle($request, function ($disk, $path) {
    // Triggered when upload is finished
});
```

### Changing the driver

[](#changing-the-driver)

You can change the default driver by setting an `UPLOAD_DRIVER` environment variable or publishing the config file and changing it directly.

### Adding your own drivers

[](#adding-your-own-drivers)

Much like Laravel's core components, you can add your own drivers for this package. You can do this by adding the following code to a service provider.

```
app()->make(UploadManager::class)->extend('my_driver', function () {
    return new MyCustomUploadDriver();
});
```

If you are adding a driver you need to extend the `\CodingSocks\UploadHandler\Driver\BaseHandler` abstract class, for which you can use the shipped drivers (e.g. `\CodingSocks\UploadHandler\Driver\BlueimpUploadDriver`) as an example as to how.

If you wrote a custom driver that others might find useful, please consider adding it to the package via a pull request.

Drivers
-------

[](#drivers)

Below is a list of available drivers along with their individual specs:

ServiceDriver nameChunk uploadResumable[Monolith](#monolith-driver)`monolith`nono[Blueimp](#blueimp-driver)`blueimp`yesyes[DropzoneJS](#dropzonejs-driver)`dropzone`yesno[Flow.js](#flowjs-driver)`flow-js`yesyes[ng-file-upload](#ng-file-upload-driver)`ng-file-upload`yesno[Plupload](#plupload-driver)`plupload`yesno[Resumable.js](#resumablejs-driver)`resumable-js`yesyes[simple-uploader.js](#simple-uploaderjs-driver)`simple-uploader-js`yesyes### Monolith driver

[](#monolith-driver)

This driver is a fallback driver as it can handle normal file request. Save and delete capabilities are also added.

### Blueimp driver

[](#blueimp-driver)

[website](https://blueimp.github.io/jQuery-File-Upload/)

This driver handles requests made by the Blueimp jQuery File Upload client library.

### DropzoneJS driver

[](#dropzonejs-driver)

[website](https://www.dropzonejs.com/)

This driver handles requests made by the DropzoneJS client library.

### Flow.js driver

[](#flowjs-driver)

[website](https://github.com/flowjs/flow.js)

This driver handles requests made by the Flow.js client library.

Because of [Issue #44](https://github.com/coding-socks/laravel-upload-handler/issues/44) you must use `forceChunkSize`option.

### ng-file-upload driver

[](#ng-file-upload-driver)

[website](https://github.com/danialfarid/ng-file-upload)

This driver handles requests made by the ng-file-upload client library.

### Plupload driver

[](#plupload-driver)

[website](https://github.com/moxiecode/plupload)

This driver handles requests made by the Plupload client library.

### Resumable.js driver

[](#resumablejs-driver)

[website](http://resumablejs.com/)

This driver handles requests made by the Resumable.js client library.

Because of [Issue #44](https://github.com/coding-socks/laravel-upload-handler/issues/44) you must use `forceChunkSize`option.

### simple-uploader.js driver

[](#simple-uploaderjs-driver)

[website](https://github.com/simple-uploader/Uploader)

This driver handles requests made by the simple-uploader.js client library.

Because of [Issue #44](https://github.com/coding-socks/laravel-upload-handler/issues/44) you must use `forceChunkSize`option.

Identifiers
-----------

[](#identifiers)

In some cases an identifier is needed for the uploaded file when the client side library does not provide one. This identifier is important for resumable uploads as the library has to be able to check the status of the given file for a specific client. Without the identifier collisions can happen.

ServiceDriver name[Session identifier](#session-identifier)`session`[Auth identifier](#auth-identifier)`auth`[NOP identifier](#nop-identifier)`nop`### Session identifier

[](#session-identifier)

This identifier uses the client session and the original file name to create an identifier for the upload file.

### Auth identifier

[](#auth-identifier)

This identifier uses the id of the authenticated user and the original file name to create an identifier for the upload file.

It will throw `UnauthorizedException` when the user is unauthorized. However, it is still recommended using the `auth` middleware.

### NOP identifier

[](#nop-identifier)

This identifier uses the original file name to create an identifier for the upload file. This does not abstract the file identifier which can be useful for testing.

Contribution
------------

[](#contribution)

All contributions are welcomed for this project, please refer to the [CONTRIBUTING.md](CONTRIBUTING.md) file for more information about contribution guidelines.

License
-------

[](#license)

This product is licensed under the MIT license, please refer to the [License file](LICENSE) for more information.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance25

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.3% 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 ~225 days

Recently: every ~327 days

Total

8

Last Release

424d ago

PHP version history (4 changes)v0.1.0PHP ^7.1

v0.2.0PHP ^7.3

v0.2.2PHP ^7.3 || ^8.0

v0.2.4PHP ^8.0

### Community

Maintainers

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

---

Top Contributors

[![nerg4l](https://avatars.githubusercontent.com/u/4079392?v=4)](https://github.com/nerg4l "nerg4l (83 commits)")[![YannikFirre](https://avatars.githubusercontent.com/u/3316758?v=4)](https://github.com/YannikFirre "YannikFirre (3 commits)")[![yak0d3](https://avatars.githubusercontent.com/u/32985181?v=4)](https://github.com/yak0d3 "yak0d3 (2 commits)")[![feherpedro](https://avatars.githubusercontent.com/u/22354939?v=4)](https://github.com/feherpedro "feherpedro (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/coding-socks-laravel-chunk-uploader/health.svg)

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

###  Alternatives

[watson/active

Laravel helper for recognising the current route, controller and action

3253.6M14](/packages/watson-active)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[beyondcode/laravel-favicon

Create dynamic favicons based on your environment settings.

37345.5k](/packages/beyondcode-laravel-favicon)[glhd/conveyor-belt

14797.0k](/packages/glhd-conveyor-belt)[dragon-code/pretty-routes

Pretty Routes for Laravel

10058.7k4](/packages/dragon-code-pretty-routes)[erlandmuchasaj/laravel-gzip

Gzip your responses.

40129.3k2](/packages/erlandmuchasaj-laravel-gzip)

PHPackages © 2026

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