12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- require dirname(__FILE__) . '/../vendor/autoload.php';
- $secretId = "SECRETID";
- $secretKey = "SECRETKEY";
- $region = "ap-beijing";
- $cosClient = new Qcloud\Cos\Client(
- array(
- 'region' => $region,
- 'schema' => 'https',
- 'credentials' => array(
- 'secretId' => $secretId,
- 'secretKey' => $secretKey
- )
- )
- );
- $local_path = "/data/exampleobject";
- try {
- $bucket = "examplebucket-1250000000";
- $key = "exampleobject";
- $signedUrl = $cosClient->getObjectUrl(
- $bucket,
- $key,
- '+10 minutes',
- [
- 'ResponseContentDisposition' => '111',
- 'Params' => [
- 'aaa' => 'bbb',
- 'ccc' => 'ddd'
- ],
- ]
- );
-
- echo $signedUrl;
- } catch (\Exception $e) {
-
- print_r($e);
- }
|