/laravel-chunk-upload-example

Example project for laravel-chunk-upload

Primary LanguagePHPMIT LicenseMIT

Laravel chunked upload example

This repo contains full example for laravel-chunk-upload package.

Requiremenets

  • PHP >= 7.0.0
  • OpenSSL PHP Extension
  • PDO PHP Extension
  • Mbstring PHP Extension
  • Tokenizer PHP Extension
  • XML PHP Extension

More at laravel.com

Installation

composer install
npm install
npm run dev
cp .env.example .env
php artisan key:generate

Versions

You can choose which version of laravel you are using.

Current branch (master) - Laravel 5.5

Laravel 5.4

Full example with at laravel-5-4 branch

Optionally serve with php artisan serve

Usage

Open the root page http://localhost:8000 and open the desired examples.

Example code

Uploading to AMAZON s3 (or any other cloud storage)

It is recommended to upload the file in separate queue JOB. Uploading can take a time (for large files) and the request could get timed out. It is important to stream the file to the cloud (not using file_get_contents) which would eat your memory. Also don't forget to remove the uploaded file after upload.

Example code found at ./app/Http/Controllers/UploadController.php.

Copyright and License

laravel-chunk-upload-example was written by Martin Kluska and is released under the MIT License.

Copyright (c) 2017 Martin Kluska