php 根据sdk重命名华为云obs临时访问 url

复制代码
public function getDownloadUrl($bucket,$path,$oldfilename){
$this->obsClient = new ObsClient([
    'key' => env('huawei.key'),
    'secret' => env('huawei.secreat'),
    'endpoint' => 'obs.cn-south-1.myhuaweicloud.com',//替换成自己的endpoint
]);
复制代码
$signedUrl = $this->obsClient->createSignedUrl(
    [
        'Method' => 'GET',
        'Bucket' => $bucket,
        'Key' => $path,
        'Expires' => 3600,
        'QueryParams' => [
            'response-content-disposition'=>'attachment;filename='.urlencode($oldfilename)
            ]
    ]
);
$signedUrl = $signedUrl['SignedUrl'];

}

相关推荐
开心香辣派小星3 小时前
23种设计模式-15解释器模式
java·设计模式·解释器模式
Halo_tjn3 小时前
虚拟机相关实验概述
java·开发语言·windows·计算机
摆烂z4 小时前
Docker与Jib(maven插件版)实战
java
RainbowSea4 小时前
从 Spring Boot 2.x 到 3.5.x + JDK21:一次完整的生产环境迁移实战
java·spring boot·后端
笨手笨脚の4 小时前
Spring Core常见错误及解决方案
java·后端·spring
奶油松果4 小时前
Springboot自动装配 - redis和redission
java·spring boot·redis
霍夫曼4 小时前
UTC时间与本地时间转换问题
java·linux·服务器·前端·javascript
VX:Fegn08954 小时前
计算机毕业设计|基于Java人力资源管理系统(源码+数据库+文档)
java·开发语言·数据库·vue.js·spring boot·后端·课程设计
荔枝hu4 小时前
springboot和shiro组合引入SseEmitter的一些坑
java·spring boot·后端·sseeitter
老华带你飞5 小时前
健身房|基于springboot + vue健身房管理系统(源码+数据库+文档)
java·数据库·vue.js·spring boot·后端