nechehin/laravel-plupload
Composer 安装命令:
composer require nechehin/laravel-plupload
包简介
Laravel Plupload - Handle large file uploads - fork of jildertmiedema/laravel-plupload
关键字:
README 文档
README
Laravel plupload support.
Handeling chunked uploads.
Installation
Install using composer
composer require nechehin/laravel-plupload
Add the provider to config/app.php
'providers' => [ JildertMiedema\LaravelPlupload\LaravelPluploadServiceProvider::class, ]
If you want to use te build in builder insert the facade
'aliases' => array( 'Plupload' => JildertMiedema\LaravelPlupload\Facades\Plupload::class, ),
To publish the assets:
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.
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.
Issues
If you are encountering a Token Mismatch Exception;
TokenMismatchException in VerifyCsrfToken.php line 53:
add in your blade file
<meta name="csrf-token" content="{{ csrf_token() }}">
in your JS file, add
headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') },
Eg:
$('.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:
echo Plupload::make([ 'url' => 'upload', 'chunk_size' => '100kb', ]);
Note: The options given to the make function are found on in the pluload documentation.
3. Extended plupload builder
echo Plupload::init([ 'url' => 'upload', 'chunk_size' => '100kb', ])->withPrefix('current')->createHtml();
Alternatives
Other packages supporting plupload:
nechehin/laravel-plupload 适用场景与选型建议
nechehin/laravel-plupload 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 1.13k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 04 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「pluload」 「large files」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 nechehin/laravel-plupload 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 nechehin/laravel-plupload 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 nechehin/laravel-plupload 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Laravel/Plupload - Handle large file uploads
Seamlessly integrate Grok AI into Laravel applications with an elegant, developer-friendly package. Leverage powerful AI models for chat, automation, and NLP while maintaining Laravel's expressive simplicity.
Laravel 5/Plupload - Handle large file uploads
erikwang2013/aetherupload-webman is a aetherupload plugin that is compatible with webman. Mainly suitable for distributed deployment, used to adapt to webman, with simple and fast installation.
Alfabank REST API integration
A module for the Fermat math library which adds statistics function.
统计信息
- 总下载量: 1.13k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-04-20