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'];
}