1 Star 2 Fork 0

wanna / dcat admin largefileupload

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Dcat Admin 大文件云直传Form扩展

功能说明

  1. 大文件分片直传
  2. 集成了七牛云、阿里云OSS
  3. 预览目前只支持img,video,其他类型文件一律只显示上传文件名

####前置包

  1. "dcat/laravel-admin": "~2.0",
  2. "zgldh/qiniu-laravel-storage": "0.10.4"(使用七牛云需要)
  3. "bmslaravel/aliyun-sts": "^1.1" (使用阿里云oss需要)

七牛云:在filesystem.php 的 disks下增加下面代码,当默认文件驱动为qiniu时自动开启前端直传和大文件分片上传

'qiniu' => [
    'driver'                 => 'qiniu',
    'domains'                => [
        'default' => env('QINIU_DOMAIN_DEFAULT'), //你的七牛域名
        'https'   => env('QINIU_DOMAIN_HTTPS'),         //你的HTTPS域名
        'custom'  => env('QINIU_DOMAIN_HTTPS'),                //Useless 没啥用,请直接使用上面的 default 项
    ],
    'access_key'             => env('QINIU_ACCESS_KEY'),  //AccessKey
    'secret_key'             => env('QINIU_SECRET_KEY'),  //SecretKey
    'bucket'                 => env('QINIU_BUCKET'),  //Bucket名字
    'notify_url'             => '',  //持久化处理回调地址
    'access'                 => 'public',  //空间访问控制 public 或 private
    'hotlink_prevention_key' => '', // CDN 时间戳防盗链的 key。 设置为 null 则不启用本功能。
    'region'                 => env('QINIU_REGION', 'z1')
],

阿里云oss: 安装bmslaravel/aliyun-sts扩展后发布配置文件sts.php,完善配置文件(里面的配置项需要进阿里云配置RAM授权策略,具体参考阿里云OSS直传手册),当默认文件驱动为oss时自动开启前端直传和大文件分片上传

使用方法

$form->largefile('videos');
$form->largefile('videos')->limit(1); //限制数量,默认为0(不限制),多个会以英文逗号隔开提交
$form->largefile('videos')->accept('video/*,image/*');//类型限制
MIT License Copyright (c) 2022 wanna Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

Dcat Admin 大文件云直传Form扩展 展开 收起
PHP 等 4 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/wulu_1_2/dcat-admin-largefileupload.git
git@gitee.com:wulu_1_2/dcat-admin-largefileupload.git
wulu_1_2
dcat-admin-largefileupload
dcat admin largefileupload
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891