Laravel plupload support.
Handeling chunked uploads.
Composer add
"require": {
// ...
"jildertmiedema/laravel-plupload": "dev-master"
},
Changes app.config
'providers' => array(
// ...
'JildertMiedema\LaravelPlupload\LaravelPluploadServiceProvider',
)
And:
'aliases' => array(
// ...
'Plupload' => 'JildertMiedema\LaravelPlupload\Facades\Plupload',
),
To publish the assets:
php artisan asset:publish "jildertmiedema/laravel-plupload"
Use this route to receive a file on the url /upload
. Of cource you can place this is a controller.
Route::post('/upload', function()
{
return Plupload::receive('file', function ($file)
{
$file->move(storage_path() . '/test/', $file->getClientOriginalName());
return 'ready';
});
});
There are 3 ways to send files with this plugin.
Use the examples found on the plupload site.
To use the builder for creating send form you can use this function:
echo Plupload::make([
'url' => 'upload',
'chunk_size' => '100kb',
]);
Note: The options given to the make function are found on in the pluload documentation.
echo Plupload::init([
'url' => 'upload',
'chunk_size' => '100kb',
])->withPrefix('current')->createHtml();
Other packages supporting plupload: