auroralzdf/big-file-upload
Composer 安装命令:
composer require auroralzdf/big-file-upload
包简介
chunk upload big file...
README 文档
README
说明
结合 Webuploader 切片上传文件功能实现,网站在处理大文件上传缓慢,或者不能上传的功能。
Laravel版本
>=5.5
安装
composer require auroralzdf/big-file-upload
php artisan vendor:publish --provider='AuroraLZDF\Bigfile\BigfileServiceProvider'
配置项
执行完 php artisan vendor:publish --provider='AuroraLZDF\Bigfile\BigfileServiceProvider',会在 config 下面生成 bigfile.php 配置文件。配置项说明:
<?php return [ /* |------------------------ | 文件每次切片尺寸 |------------------------ */ 'chunk_size' => 1024 * 1024 * 2, /* |------------------------ | 允许上传文件最大尺寸 |------------------------ */ 'max_size' => 1024 * 1024 * 1024, /* |------------------------ | 文件保存路径 |------------------------ */ 'save_path' => 'upload/' . date('Y') . '/' . date('m') . '/', /* |------------------------ | 文件切片缓存路径 |------------------------ */ 'tmp_path' => storage_path('app/public/tmp'), /* |------------------------ | 允许上传文件类型 |------------------------ */ 'allow_type' => ['jpg', 'jpeg', 'gif', 'png', 'mp4', 'mp3', 'zip', 'apk', 'pdf', 'rar'], /* |------------------------ | 切片文件是否随机命名 |------------------------ */ 'rand_name' => true, /* |------------------------ | 是否删除临时文件 |------------------------ */ 'remove_tmp_file' => true, ];
访问路由
Route::middleware('web')->get('/upload/bigfile', '\AuroraLZDF\Bigfile\Controllers\BigfileController@loadView')->name('bigfile_view'); // bindings:不限制API访问次数限制,不需要 csrf_token 验证 Route::middleware('bindings')->post('/upload/bigfile', '\AuroraLZDF\Bigfile\Controllers\BigfileController@upload')->name('bigfile_upload');
...
auroralzdf/big-file-upload 适用场景与选型建议
auroralzdf/big-file-upload 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 672 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 03 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 auroralzdf/big-file-upload 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 auroralzdf/big-file-upload 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 672
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2019-03-01