定制 aminrafiei/laravel-chunker 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

aminrafiei/laravel-chunker

Composer 安装命令:

composer require aminrafiei/laravel-chunker

包简介

This package is useful for handle chunk files in Laravel easily

README 文档

README

Latest Stable Version Total Downloads License PHP Version Require

This package help you to handle chunk files in Laravel easily, and at the end it convert files to one file.

Installation

You can download it via composer.

  composer require aminrafiei/laravel-chunker
  php artisan migrate

For publish config files:

  php artisan vendor:publish

Requirements:

  • PHP v7.3 or above
  • Laravel v7.0 or above

Note:

This package use disk driver for store files and write chunk files in laravel storage path if you need another path or another driver use can edit in config file.

Also you can implement your own storage driver by implement FileServiceContract

return [
    'save_path' => storage_path('chunker'),
    'storage_driver' => \Aminrafiei\Chunker\Services\File\SimpleDiskService::class,
];

Usage/Examples

In 3 steps you can handle chunk files!

First init then make in progress then make it done!

1) Init

For initialize chunk file porcess you should use:

  use Aminrafiei\Chunker\Facades\Chunker;

  $chunkId = Chunker::init($name, $type, $totalChunks, $totalSize);

2) Progress

For handle chunk files and store use should use:

  use Aminrafiei\Chunker\Facades\Chunker;

  Chunker::progress($chunkId, $chunkNumber, $file);

3) Done

At the end when all chunk files uploaded for combine to one file you should call:

  use Aminrafiei\Chunker\Facades\Chunker;

  $response = Chunker::done($chunkId);
  $path = $response->getRealPath();

统计信息

  • 总下载量: 159
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-01-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固