File tree Expand file tree Collapse file tree 1 file changed +19
-12
lines changed Expand file tree Collapse file tree 1 file changed +19
-12
lines changed Original file line number Diff line number Diff line change 99 array (
1010 'region ' => $ region ,
1111 'schema ' => 'https ' , //协议头部,默认为http
12- 'credentials ' => array (
13- 'secretId ' => $ secretId ,
14- 'secretKey ' => $ secretKey )));
12+ 'credentials ' => array (
13+ 'secretId ' => $ secretId ,
14+ 'secretKey ' => $ secretKey
15+ )
16+ )
17+ );
1518$ local_path = "/data/exampleobject " ;
1619
17- try {
20+ try {
1821 $ bucket = "examplebucket-1250000000 " ; //存储桶,格式:BucketName-APPID
1922 $ key = "exampleobject " ; //对象在存储桶中的位置,即对象键
20- $ signedUrl = $ cosClient ->getObjectUrl ($ bucket ,
21- $ key ,
22- '+10 minutes ' //签名的有效时间
23- ['ResponseContentDisposition ' => '111 ' ,
24- 'Params ' => [ // Params中可以传自定义querystring
25- 'aaa ' => 'bbb ' ,
26- 'ccc ' => 'ddd '
27- ]]);
23+ $ signedUrl = $ cosClient ->getObjectUrl (
24+ $ bucket ,
25+ $ key ,
26+ '+10 minutes ' , //签名的有效时间
27+ [
28+ 'ResponseContentDisposition ' => '111 ' ,
29+ 'Params ' => [ // Params中可以传自定义querystring
30+ 'aaa ' => 'bbb ' ,
31+ 'ccc ' => 'ddd '
32+ ]
33+ ]
34+ );
2835 // 请求成功
2936 echo $ signedUrl ;
3037} catch (\Exception $ e ) {
You can’t perform that action at this time.
0 commit comments