Skip to content

ChaosPower/laravel-plupload

 
 

Repository files navigation

laravel-plupload

Laravel plupload support.

Handeling chunked uploads.

Installation

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"

Receiving files

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';
	});
});

Sending files

There are 3 ways to send files with this plugin.

1. Use default plupload html

Use the examples found on the plupload site.

2. Simple plupload builder

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.

2. Extended plupload builder

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

Alternatives

Other packages supporting plupload:

About

Laravel plupload support - Handle large file uploads

Resources

License

Stars

Watchers

Forks

Packages

No packages published