codegor/laravel-file-process 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

codegor/laravel-file-process

Composer 安装命令:

composer require codegor/laravel-file-process

包简介

Laravel file receive with base64 encode, store it and generate file url. Than you can get the file with the url

README 文档

README

A laravel plugin for receive base64 file, store and generate url. Then get the file from the url.

How to install?

  1. Install File API

    composer require codegor/laravel-file-process
  2. publish config file

    php artisan vendor:publish --provider="Codegor\Upload\Providers\UploadServiceProvider" --tag=config

How to config?

in config/upload.php

  1. fill in the extansion of acepted files.

    'extantion' => 'jpeg,jpg,png,bmp,svg,gif,pdf,doc,docx,xls,xlsx',
  2. fill in the secret for url encode (.env or config/upload.php).

    .env

    UPLOAD_SECRET=TZi+PA3dT8BR7yproQcqUryieefUbp3iedGQXCMvcSA=
    UPLOAD_VI=+dOnDRg9kO8arkWlsLDyMQ==

    You can regenerate it paste to PHP Tester this code:

    <?php
    echo 'UPLOAD_SECRET='.base64_encode(openssl_random_pseudo_bytes(32));
    echo PHP_EOL;
    echo 'UPLOAD_VI='.base64_encode(openssl_random_pseudo_bytes(openssl_cipher_iv_length('AES-256-CBC')));
  3. fill in the route group for grop of route file - (def route path is '/file/{hash}')

    'route_group' => [... your group route config],

How to use?

For save file from a client (file in base64 encoding) do this:

$url = \Codegor\Upload\Store::uploadFileRndName($extentionOfFile, $base64DataOfFile); 
// $url = '/file/xozYGselci9i70cTdmpvWkrYvGN9AmA7djc5eOcFoAM='

If you try to view from the browser the $url you will see it, becouse route and contoller present on this library.

Store path: {storege}/app/file/{user_id}[/0..xx?]/{hash}.{ext}

More informayion you can see at code (folder src)

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固