1.
选择对象存储,打开你的域名地址管理
2.打开空间管理,点击你所创建的空间
3.进入文件管理
在这里我们可以看到上传的文件
2、
thinkPHP6的代码 以及扩展安装
先安装扩展
两条命令:
composer require death_satan/think-qiniu-storage -vvv
composer require overtrue/laravel-filesystem-qiniu -vvv
在
上图代码
‘qiniu’ => [
‘type’=>’qiniu’,
‘accessKey’=>’…………………………’,//你的accessKey
‘secretKey’=>’…………………………’,//你的secretKey
‘bucket’=>’…………………………’,//你的存储空间名
‘domain’=>’…………………………’ //你的七牛云加速域名
],
在密匙管理中找到你的AK和SK
在空间概览中找到测试域名
最后打开config.php 中的filesysytem.php配置文件底部加入
而后上传时,将disk的响应父文件改为 'qiniu' 即可上传至七牛云服务空间
$savename = \think\facade\Filesystem::disk('qiniu')->putFile( 'topic', $file);
上传成功
3、浏览对应的图片
如果是laravel框架,可以在进行这一步的同时进行入库存储处理。
使用getDriver()->downloadUrl进行URL获取
$path = $request->file('file');
$disk = Storage::disk('qiniu');//使用七牛云
$fileName = time().rand(1000,9999).'.jpg';
$root = $disk->put($fileName,$path);//上传
$root = $disk->getDriver()->downloadUrl($root);//获取下载链接
return $root;
至此 七牛云 也就是云存储的上传和浏览 完成