qktong / think-cloudfile
基于thinkphp6,上传文件至七牛云
Installs: 13
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:think-extend
Requires
- qiniu/php-sdk: ^7.2
This package is auto-updated.
Last update: 2025-03-18 00:22:49 UTC
README
- PHP >= 7.1
- thinkphp >= 6.0
介绍
基于thinkphp6,上传文件至七牛云
安装
composer require "qktong/cloudfile"
使用
//上传文件 use qktong\cloudfile\FileService; $fileService = new FileService(); $user_id = '8'; $file_name = 'test': $extension = 'jpg'; $mime = 'image/jpeg'; $bucket = 'test'; $streamData = file_get_contents('php://input'); $key = $fileService->upload($user_id, $extension, $file_name, $mime, $streamData, $bucket);
//上传文件 use qktong\cloudfile\FileService; $keys = 'test.jpg'; $fileService = new FileService(); $result = $fileService->getFileUrl($keys,'');