recca0120 / upload
Ajax Upload Large File Support jQuery-File-Upload, FileApi, Plupload, For framework Laravel
Installs: 5 521
Dependents: 0
Suggesters: 0
Security: 0
Stars: 79
Watchers: 4
Forks: 18
Open Issues: 0
Requires
- php: ^7.3|^8.0
- illuminate/filesystem: ^8.0|^9.0|^10.0|^11.0
- illuminate/http: ^8.0|^9.0|^10.0|^11.0
Requires (Dev)
- illuminate/config: ^8.0|^9.0|^10.0|^11.0
- illuminate/container: ^8.0|^9.0|^10.0|^11.0
- mikey179/vfsstream: ^1.6
- mockery/mockery: ^1.0
- nesbot/carbon: ^2.0.0
- phpunit/phpunit: ^7.0|^8.0|^9.0|^10.0
- roave/security-advisories: dev-latest
- dev-master
- v2.2.0
- v2.1.4
- v2.1.3
- v2.1.2
- v2.1.1
- v2.1.0
- v2.0.2
- v2.0.1
- v2.0.0
- v1.7.3
- v1.7.2
- v1.7.1
- v1.7.0
- v1.6.2
- v1.6.1
- v1.6.0
- v1.5.9
- v1.5.8
- v1.5.7
- v1.5.6
- v1.5.5
- v1.5.4
- v1.5.3
- v1.5.2
- v1.5.1
- v1.5.0
- v1.4.1
- v1.4.0
- v1.3.3
- v1.3.1
- v1.3.0
- v1.2.9
- v1.2.8
- v1.2.7
- v1.2.6
- v1.2.5
- v1.2.4
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.0
- v1.0.0
- v0.0.4
- dev-develop
This package is auto-updated.
Last update: 2024-12-11 21:54:42 UTC
README
Pure Ajax Upload And for Laravel (Support jQuery-File-Upload, FileApi, Plupload)
Features
- Support Chunks jQuery-File-Upload $driver = 'fileapi';
- Support Chunks Dropzone $driver = 'dropzone';
- Support Chunks FileApi $driver = 'fileapi';
- Support Chunks Fine Uploader $driver = 'fine-uploader';
- Support Chunks Plupload $driver = 'plupload';
- Support Chunks Filepond $driver = 'filepond'
Installing
To get the latest version of Laravel Exceptions, simply require the project using Composer:
composer require recca0120/upload
Laravel
publish
artisan vendor:publish --provider="Recca0120\Upload\UploadServiceProvider"
How to use
Controller
use Illuminate\Http\JsonResponse; use Illuminate\Http\UploadedFile; use Recca0120\Upload\UploadManager; class UploadController extends Controller { public function upload(UploadManager $manager) { $driver = 'plupload'; // or 'fileapi' $inputName = 'file'; // $_FILES index; return $manager->driver($driver)->receive($inputName); // or return $manager ->driver($driver) ->receive($inputName, function (UploadedFile $uploadedFile, $path, $domain, $api) { $filename = $uploadedFile->getBasename(); return new JsonResponse([ 'name' => $uploadedFile->getClientOriginalName(), 'tmp_name' => $path.$filename, 'type' => $uploadedFile->getMimeType(), 'size' => $uploadedFile->getSize(), 'url' => $domain.$path.$filename, ]); }); } }
Factory
use Recca0120\Upload\Receiver; use Illuminate\Http\JsonResponse; require __DIR__.'/vendor/autoload.php'; $config = [ 'chunks' => 'path_to_chunks', 'storage' => 'path_to_storage', 'domain' => 'http://app.dev/', 'path' => 'web_path' ]; Receiver::factory($config, 'fileapi')->receive('file')->send();
Standalone
use Recca0120\Upload\Drivers\FileAPI; use Recca0120\Upload\Receiver; require __DIR__.'/vendor/autoload.php'; $config = [ 'chunks' => 'path_to_chunks', 'storage' => 'path_to_storage', 'domain' => 'http://app.dev/', 'path' => 'web_path' ]; // if use Plupload, new Recca0120\Upload\Plupload $receiver = new Receiver(new FileAPI($config)); // save to $config['storage']; $receiver->receive('file')->send();