Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ project at the moment is [tus](https://tus.io/).
- [Monolith](#monolith-driver)
- [Blueimp](#blueimp-driver)
- [DropzoneJS](#dropzonejs-driver)
- [Flow.js](#flow-js-driver)
- [Resumable.js](#resumable-js-driver)
- [Identifiers](#identifiers)
- [Session identifier](#session-identifier)
Expand Down Expand Up @@ -148,6 +149,7 @@ Service | Driver name | Chunk upload | Resumable
[Monolith](#monolith-driver) | `monolith` | no | no
[Blueimp](#blueimp-driver) | `blueimp` | yes | yes
[DropzoneJS](#dropzonejs-driver) | `dropzone` | yes | no
[Flow.js](#flow-js-driver) | `flow-js` | yes | yes
[Resumable.js](#resumable-js-driver) | `resumable-js` | yes | yes

### Monolith driver
Expand All @@ -166,6 +168,12 @@ This driver handles requests made by the Blueimp jQuery File Upload client libra

This driver handles requests made by the DropzoneJS client library.

### Flow.js driver

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

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

### Resumable.js driver

[website](http://resumablejs.com/)
Expand Down
23 changes: 22 additions & 1 deletion config/chunk-uploader.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
| throughout your application here. By default, the module is setup for
| monolith upload.
|
| Supported: "monolith", "blueimp", "dropzone", "resumable-js"
| Supported: "monolith", "blueimp", "dropzone", "flow-js", "resumable-js"
|
*/

Expand Down Expand Up @@ -118,6 +118,27 @@

],

/*
|--------------------------------------------------------------------------
| Flow.js Options
|--------------------------------------------------------------------------
|
| Here you may configure the options for the Flow.js driver.
|
*/

'flow-js' => [

// The name of the multipart request parameter to use for the file chunk
'param' => 'file',

// HTTP method for chunk test request.
'test-method' => Illuminate\Http\Request::METHOD_GET,
// HTTP method to use when sending chunks to the server (POST, PUT, PATCH).
'upload-method' => Illuminate\Http\Request::METHOD_POST,

],

/*
|--------------------------------------------------------------------------
| Resumable.js Options
Expand Down
35 changes: 35 additions & 0 deletions src/Driver/FlowJsUploadDriver.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

namespace CodingSocks\ChunkUploader\Driver;

class FlowJsUploadDriver extends ResumableJsUploadDriver
{
/**
* ResumableJsUploadDriver constructor.
*
* @param array $config
*/
public function __construct($config)
{
$config['parameter-namespace'] = '';
$config['parameter-names'] = [
// The name of the chunk index (base-1) in the current upload POST parameter to use for the file chunk.
'chunk-number' => 'flowChunkNumber',
// The name of the total number of chunks POST parameter to use for the file chunk.
'total-chunks' => 'flowTotalChunks',
// The name of the general chunk size POST parameter to use for the file chunk.
'chunk-size' => 'flowChunkSize',
// The name of the total file size number POST parameter to use for the file chunk.
'total-size' => 'flowTotalSize',
// The name of the unique identifier POST parameter to use for the file chunk.
'identifier' => 'flowIdentifier',
// The name of the original file name POST parameter to use for the file chunk.
'file-name' => 'flowFilename',
// The name of the file's relative path POST parameter to use for the file chunk.
'relative-path' => 'flowRelativePath',
// The name of the current chunk size POST parameter to use for the file chunk.
'current-chunk-size' => 'flowCurrentChunkSize',
];
parent::__construct($config);
}
}
6 changes: 6 additions & 0 deletions src/UploadManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Illuminate\Support\Manager;
use CodingSocks\ChunkUploader\Driver\BlueimpUploadDriver;
use CodingSocks\ChunkUploader\Driver\DropzoneUploadDriver;
use CodingSocks\ChunkUploader\Driver\FlowJsUploadDriver;
use CodingSocks\ChunkUploader\Driver\MonolithUploadDriver;
use CodingSocks\ChunkUploader\Driver\ResumableJsUploadDriver;

Expand All @@ -28,6 +29,11 @@ public function createDropzoneDriver()
return new DropzoneUploadDriver($this->app['config']['chunk-uploader.dropzone']);
}

public function createFlowJsDriver()
{
return new FlowJsUploadDriver($this->app['config']['chunk-uploader.resumable-js']);
}

public function createResumableJsDriver()
{
return new ResumableJsUploadDriver($this->app['config']['chunk-uploader.resumable-js']);
Expand Down
Loading