Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 19 additions & 12 deletions sample/getObjectUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,29 @@
array(
'region' => $region,
'schema' => 'https', //协议头部,默认为http
'credentials'=> array(
'secretId' => $secretId ,
'secretKey' => $secretKey)));
'credentials' => array(
'secretId' => $secretId,
'secretKey' => $secretKey
)
)
);
$local_path = "/data/exampleobject";

try {
try {
$bucket = "examplebucket-1250000000"; //存储桶,格式:BucketName-APPID
$key = "exampleobject"; //对象在存储桶中的位置,即对象键
$signedUrl = $cosClient->getObjectUrl($bucket,
$key,
'+10 minutes' //签名的有效时间
['ResponseContentDisposition' => '111',
'Params' => [ // Params中可以传自定义querystring
'aaa' => 'bbb',
'ccc' => 'ddd'
]]);
$signedUrl = $cosClient->getObjectUrl(
$bucket,
$key,
'+10 minutes', //签名的有效时间
[
'ResponseContentDisposition' => '111',
'Params' => [ // Params中可以传自定义querystring
'aaa' => 'bbb',
'ccc' => 'ddd'
]
]
);
// 请求成功
echo $signedUrl;
} catch (\Exception $e) {
Expand Down