drazwx/ruinuo-attachment-upload
Composer 安装命令:
composer require drazwx/ruinuo-attachment-upload
包简介
upload file to oos,qiniucloud or cos
README 文档
README
tp6集成qiniu、oss、cos上传
composer
composer require drazwx/ruinuo-attachment-upload
使用方法
config/filesystem.php中增加对应驱动配置
return [
"default" => "qiniu",
"disks" => [
"public" => [
"type" => "local",
"root" => ".",
"visibility" => "public",
"domain" => ""
],
"qiniu" => [
"type" => "qiniu",
"accessKey" => "",
"secretKey" => "",
"bucket" => "",
"domain" => ""
],
"oss" => [
"type" => "oss",
"accessId" => "",
"accessSecret" => "",
"bucket" => "",
"endpoint" => "",
"domain" => ""
],
"cos" => [
"type" => "cos",
"region" => "ap-guangzhou",
"credentials" => [
"appId" => "",
"secretId" => "",
"secretKey" => ""
],
"bucket" => "",
"domain" => "",
"scheme" => "http"
]
]
];
上传
$file = $this->request->file('file');
\think\facade\Filesystem::disk('oss')->putFile('upload', $file);
删除
\think\facade\Filesystem::disk('oss')->delete($path);
更详细用法参考Adapter对应文件
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-11-09