2017 © Pedro Peláez
 

library laravel-plupload

Laravel 5/Plupload - Handle large file uploads

image

jildertmiedema/laravel-plupload

Laravel 5/Plupload - Handle large file uploads

  • Wednesday, May 23, 2018
  • by jildertmiedema
  • Repository
  • 8 Watchers
  • 115 Stars
  • 46,192 Installations
  • JavaScript
  • 1 Dependents
  • 0 Suggesters
  • 35 Forks
  • 2 Open issues
  • 8 Versions
  • 8 % Grown

The README.md

laravel-plupload

Laravel plupload support., (*1)

Handeling chunked uploads., (*2)

Installation

Install using composer, (*3)

composer require jildertmiedema/laravel-plupload

Add the provider to config/app.php, (*4)

'providers' => [
    JildertMiedema\LaravelPlupload\LaravelPluploadServiceProvider::class,
]

If you want to use te build in builder insert the facade, (*5)

'aliases' => array(
    'Plupload' => JildertMiedema\LaravelPlupload\Facades\Plupload::class,
),

To publish the assets:, (*6)

php artisan vendor:publish

Receiving files

Use this route to receive a file on the url /upload. Of course you can place this is a controller., (*7)

Route::post('/upload', function()
{
    return Plupload::receive('file', function ($file)
    {
        $file->move(storage_path() . '/test/', $file->getClientOriginalName());

        return 'ready';
    });
});

Sending files

There are 3 ways to send files with this plugin., (*8)

1. Use default plupload html

Use the examples found on the plupload site., (*9)

Issues

If you are encountering a Token Mismatch Exception;, (*10)

TokenMismatchException in VerifyCsrfToken.php line 53:

add in your blade file, (*11)

<meta name="csrf-token" content="{{ csrf_token() }}">

in your JS file, add, (*12)

headers: {
        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
    },

Eg:, (*13)

$('.js-uploader').pluploadQueue({

    // General settings
    runtimes: 'html5,flash,silverlight,html4',
    url: '/upload/',
    chunk_size: '200kb',
    rename: false,
    dragdrop: true,
    // add X-CSRF-TOKEN in headers attribute to fix this issue
    headers: {
        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
    },
    // add more overrides; see documentation...

});

2. Simple plupload builder

To use the builder for creating send form you can use this function:, (*14)

echo Plupload::make([
    'url' => 'upload',
    'chunk_size' => '100kb',
]);

Note: The options given to the make function are found on in the pluload documentation., (*15)

3. Extended plupload builder

echo Plupload::init([
    'url' => 'upload',
    'chunk_size' => '100kb',
])->withPrefix('current')->createHtml();

Alternatives

Other packages supporting plupload:, (*16)

The Versions

23/05 2018

dev-master

9999999-dev

Laravel 5/Plupload - Handle large file uploads

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jildert Miedema

laravel pluload large files

23/05 2018

v0.4.2

0.4.2.0

Laravel 5/Plupload - Handle large file uploads

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jildert Miedema

laravel pluload large files

07/12 2016

v0.4.1

0.4.1.0

Laravel 5/Plupload - Handle large file uploads

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jildert Miedema

laravel pluload large files

18/07 2016

v0.3.1

0.3.1.0

Laravel 5/Plupload - Handle large file uploads

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jildert Miedema

laravel pluload large files

18/06 2015

v0.3.0

0.3.0.0

Laravel 5/Plupload - Handle large file uploads

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jildert Miedema

laravel pluload large files

22/07 2014

v0.2.1

0.2.1.0

Laravel 4/Plupload - Handle large file uploads

  Sources   Download

MIT

The Requires

 

by Jildert Miedema

laravel pluload large files

06/05 2014

v0.2

0.2.0.0

Laravel 4/Plupload - Handle large file uploads

  Sources   Download

MIT

The Requires

 

by Jildert Miedema

laravel pluload large files

07/01 2014

v0.1

0.1.0.0

  Sources   Download

The Requires

 

by Jildert Miedema