# webupoloader-bigFile **Repository Path**: auroraLZDF/webupoloader-bigFile ## Basic Information - **Project Name**: webupoloader-bigFile - **Description**: 结合 Webuploader 切片上传文件功能实现,网站在处理大文件上传缓慢,或者不能上传的功能。 - **Primary Language**: PHP - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 52 - **Forks**: 4 - **Created**: 2019-02-28 - **Last Updated**: 2025-08-07 ## Categories & Tags **Categories**: webui **Tags**: None ## README # Laravel Bigfile Upload ## 说明 结合 `Webuploader` 切片上传文件功能实现,网站在处理大文件上传缓慢,或者不能上传的功能。 ## Laravel版本 `>=5.5` ## 安装 ```bash 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 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, ]; ``` ## 访问路由 ```php 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'); ``` ...