API | 操作名 | 操作描述 |
简单上传对象 | 上传一个对象至存储桶 | |
设置对象复制(修改对象属性) | 复制文件到目标路径 | |
追加上传对象 | 将对象以分块追加的方式上传至存储桶 |
API | 操作名 | 操作描述 |
查询分块上传 | 查询正在进行中的分块上传信息 | |
初始化分块上传 | 初始化分块上传任务 | |
上传分块 | 分块上传对象 | |
复制分块 | 将其他对象复制为一个分块 | |
查询已上传块 | 查询特定分块上传操作中的已上传的块 | |
完成分块上传 | 完成整个对象的分块上传 | |
终止分块上传 | 终止一个分块上传操作并删除已上传的块 |
public Qcloud\\Cos\\Client upload(string $bucket, string $key, $body, array $options = array());
PUT Object
和Upload Part
接口。参数名称 | 类型 | 描述 | 是否必填 |
bucket | String | 存储桶名称,格式:BucketName-APPID | 是 |
key | String | 对象键 | 是 |
body | Stream/String | 上传的内容 | 是 |
options | Array | 附加的配置项 | 否 |
options 参数 | 类型 | 描述 | 是否必填 |
Progress | Function | 进度条回调,参数为总大小($totalSize), 已上传大小($uploadedSize) | 否 |
PartSize | Int | 最小分块文件大小,默认为5M | 否 |
Concurrency | Int | 并发度,默认为10 | 否 |
ACL | String | 设置对象的 ACL,例如 private、public-read | 否 |
CacheControl | String | 缓存策略,设置 Cache-Control | 否 |
ContentDisposition | String | 文件名称,设置 Content-Disposition | 否 |
ContentEncoding | String | 编码格式,设置 Content-Encoding | 否 |
ContentLanguage | String | 语言类型,设置 Content-Language | 否 |
ContentLength | Int | 设置传输长度 | 否 |
ContentType | String | 内容类型,设置 Content-Type | 否 |
Expires | String | 设置 Content-Expires | 否 |
Metadata | Array | 用户自定义的文件元信息 | 否 |
StorageClass | String | 文件的存储类型,例如 STANDARD、STANDARD_IA、ARCHIVE,默认值:STANDARD。更多存储类型,请参见 存储类型概述 | 否 |
ContentMD5 | Boolean | 是否自动生成上传文件的 MD5 值用于校验 | 否 |
ServerSideEncryption | String | 服务端加密方法 | 否 |
<?phprequire dirname(__FILE__) . '/../vendor/autoload.php';$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.tencentcloud.com/cos5/bucket$cosClient = new Qcloud\\Cos\\Client(array('region' => $region,'schema' => 'https', //协议头部,默认为http'credentials'=> array('secretId' => $secretId ,'secretKey' => $secretKey)));$local_path = "/Users/xxx/Desktop/exampleobject.txt"; //保存到用户本地路径try {$result = $cosClient->upload($bucket = 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.tencentcloud.com/cos5/bucket$key = 'exampleobject', //此处的 key 为对象键$body = fopen($local_path, 'rb'));// 请求成功print_r($result);} catch (\\Exception $e) {// 请求失败echo($e);}
<?phprequire dirname(__FILE__) . '/../vendor/autoload.php';$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.tencentcloud.com/cos5/bucket$cosClient = new Qcloud\\Cos\\Client(array('region' => $region,'schema' => 'https', //协议头部,默认为http'credentials'=> array('secretId' => $secretId ,'secretKey' => $secretKey)));$local_path = "/Users/xxx/Desktop/exampleobject.txt"; //保存到用户本地路径try {$result = $cosClient->upload($bucket = 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.tencentcloud.com/cos5/bucket$key = 'exampleobject', //此处的 key 为对象键$body = fopen($local_path, 'rb'),$options = array('StorageClass' => 'Archive'));// 请求成功print_r($result);} catch (\\Exception $e) {// 请求失败echo($e);}
<?phprequire dirname(__FILE__) . '/../vendor/autoload.php';$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.tencentcloud.com/cos5/bucket$cosClient = new Qcloud\\Cos\\Client(array('region' => $region,'schema' => 'https', //协议头部,默认为http'credentials'=> array('secretId' => $secretId ,'secretKey' => $secretKey)));$local_path = "/Users/xxx/Desktop/exampleobject.txt"; //保存到用户本地路径try {$result = $cosClient->upload($bucket = 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.tencentcloud.com/cos5/bucket$key = 'exampleobject', //此处的 key 为对象键$body = fopen($local_path, 'rb'),$options = array('Metadata' => array('string' => 'string',),'PartSize' => 10 * 1024 * 1024));// 请求成功print_r($result);} catch (\\Exception $e) {// 请求失败echo($e);}
<?phprequire dirname(__FILE__) . '/../vendor/autoload.php';$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.tencentcloud.com/cos5/bucket$cosClient = new Qcloud\\Cos\\Client(array('region' => $region,'schema' => 'https', //协议头部,默认为http'credentials'=> array('secretId' => $secretId ,'secretKey' => $secretKey)));$local_path = "/Users/xxx/Desktop/exampleobject.txt"; //保存到用户本地路径try {//生成一个随机字符串作为上传的body$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';$randomString = '';for ($i = 0; $i < 10; $i++) {$randomString .= $characters[rand(0, strlen($characters) - 1)];}//块大小$partSize = 1024 * 1024 + 1;//初始化分块上传$rt = $this->cosClient->CreateMultipartUpload(array('Bucket' => $this->bucket,'Key' => $this->key));//获取上传ID$uploadId = $rt['UploadId'];//上传分块$this->cosClient->uploadPart(array('Bucket' => $this->bucket,'Key' => $this->key,'Body' => substr($body, 0, $partSize),'UploadId' => $uploadId,'PartNumber' => 1));//断点续传$this->cosClient->resumeUpload($bucket=$this->bucket,$this->key,$body,$uploadId,array('PartSize'=>$partSize));} catch (\\Exception $e) {// 请求失败echo($e);}
<?phprequire dirname(__FILE__) . '/../vendor/autoload.php';$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.tencentcloud.com/cos5/bucket$cosClient = new Qcloud\\Cos\\Client(array('region' => $region,'schema' => 'https', //协议头部,默认为http'credentials'=> array('secretId' => $secretId ,'secretKey' => $secretKey)));function uploadfiles( $path, $cosClient ) {foreach ( scandir( $path ) as $afile ) {if ( $afile == '.' || $afile == '..' ) continue;if ( is_dir( $path.'/'.$afile ) ) {uploadfiles( $path.'/'.$afile, $cosClient );} else {$local_file_path = $path.'/'.$afile;$cos_file_path = $local_file_path;// 按照需求自定义拼接上传路径try {$cosClient->upload($bucket = 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.tencentcloud.com/cos5/bucket$key = $cos_file_path,$body = fopen( $cos_file_path, 'rb' ));} catch ( \\Exception $e ) {echo( $e );}}}}$local_path = '/data/home/folder';uploadfiles( $local_path, $cosClient );
public Guzzle\\Service\\Resource\\Model putObject(array $args = array())
<?phprequire dirname(__FILE__) . '/../vendor/autoload.php';$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.tencentcloud.com/cos5/bucket$cosClient = new Qcloud\\Cos\\Client(array('region' => $region,'schema' => 'https', //协议头部,默认为http'credentials'=> array('secretId' => $secretId ,'secretKey' => $secretKey)));$local_path = "/Users/xxx/Desktop/exampleobject.txt"; //保存到用户本地路径try {$result = $cosClient->putObject(array('Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.tencentcloud.com/cos5/bucket'Key' => 'exampleobject','Body' => fopen($local_path, 'rb'),));// 请求成功print_r($result);} catch (\\Exception $e) {// 请求失败echo($e);}
<?phprequire dirname(__FILE__) . '/../vendor/autoload.php';$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.tencentcloud.com/cos5/bucket$cosClient = new Qcloud\\Cos\\Client(array('region' => $region,'schema' => 'https', //协议头部,默认为http'credentials'=> array('secretId' => $secretId ,'secretKey' => $secretKey)));$local_path = "/Users/xxx/Desktop/exampleobject.txt"; //保存到用户本地路径try {$result = $cosClient->putObject(array('Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.tencentcloud.com/cos5/bucket'Key' => 'exampleobject','Body' => fopen($local_path, 'rb'),'StorageClass' => 'Archive'));// 请求成功print_r($result);} catch (\\Exception $e) {// 请求失败echo($e);}
<?phprequire dirname(__FILE__) . '/../vendor/autoload.php';$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.tencentcloud.com/cos5/bucket$cosClient = new Qcloud\\Cos\\Client(array('region' => $region,'schema' => 'https', //协议头部,默认为http'credentials'=> array('secretId' => $secretId ,'secretKey' => $secretKey)));$local_path = "/Users/xxx/Desktop/exampleobject.txt"; //保存到用户本地路径try {$result = $cosClient->putObject(array('Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.tencentcloud.com/cos5/bucket'Key' => 'exampleobject','Body' => fopen($local_path, 'rb'),'ContentType' => 'text/xml'));// 请求成功print_r($result);} catch (\\Exception $e) {// 请求失败echo($e);}
<?phprequire dirname(__FILE__) . '/../vendor/autoload.php';$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.tencentcloud.com/cos5/bucket$cosClient = new Qcloud\\Cos\\Client(array('region' => $region,'schema' => 'https', //协议头部,默认为http'credentials'=> array('secretId' => $secretId ,'secretKey' => $secretKey)));try {$result = $cosClient->putObject(array('Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.tencentcloud.com/cos5/bucket'Key' => 'folder/','Body' => "",));// 请求成功print_r($result);} catch (\\Exception $e) {// 请求失败echo($e);}
<?phprequire dirname(__FILE__) . '/../vendor/autoload.php';$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.tencentcloud.com/cos5/bucket$cosClient = new Qcloud\\Cos\\Client(array('region' => $region,'schema' => 'https', //协议头部,默认为http'credentials'=> array('secretId' => $secretId ,'secretKey' => $secretKey)));$local_path = "/Users/xxx/Desktop/exampleobject.txt"; //保存到用户本地路径try {$result = $cosClient->putObject(array('Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.tencentcloud.com/cos5/bucket'Key' => 'exampleobject','Body' => fopen($local_path, 'rb'),'ContentMD5' => true,));// 请求成功print_r($result);} catch (\\Exception $e) {// 请求失败echo($e);}
<?phprequire dirname(__FILE__) . '/../vendor/autoload.php';$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.tencentcloud.com/cos5/bucket$cosClient = new Qcloud\\Cos\\Client(array('region' => $region,'schema' => 'https', //协议头部,默认为http'credentials'=> array('secretId' => $secretId ,'secretKey' => $secretKey)));$local_path = "/Users/xxx/Desktop/exampleobject.txt"; //保存到用户本地路径try {$result = $cosClient->putObject(array('Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.tencentcloud.com/cos5/bucket'Key' => 'exampleobject','Body' => fopen($local_path, 'rb'),'TrafficLimit' => 8 * 1024 * 1024 // 限制为1MB/s));// 请求成功print_r($result);} catch (\\Exception $e) {// 请求失败echo($e);}
参数名称 | 类型 | 描述 | 是否必填 |
Bucket | String | 存储桶名称,格式:BucketName-APPID | 是 |
Key | String | 此处的 Key 为对象键,对象键是对象在存储桶中的唯一标识。例如,在对象的访问域名 examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/doc/pic.jpg 中,对象键为doc/pic.jpg | 否 |
ACL | String | 设置对象的 ACL,例如 private、public-read | 否 |
Body | Stream/String | 上传的内容 | 是 |
CacheControl | String | 缓存策略,设置 Cache-Control | 否 |
ContentDisposition | String | 文件名称,设置 Content-Disposition | 否 |
ContentEncoding | String | 编码格式,设置 Content-Encoding | 否 |
ContentLanguage | String | 语言类型,设置 Content-Language | 否 |
ContentLength | Int | 设置传输长度 | 否 |
ContentType | String | 内容类型,设置 Content-Type | 否 |
Expires | String | 设置 Content-Expires | 否 |
Metadata | Array | 用户自定义的文件元信息 | 否 |
StorageClass | String | 文件的存储类型,例如 STANDARD、STANDARD_IA、ARCHIVE,默认值:STANDARD。更多存储类型,请参见 存储类型概述 | 否 |
ContentMD5 | Boolean | 是否自动生成上传文件的 MD5 值用于校验 | 否 |
ServerSideEncryption | String | 服务端加密方法 | 否 |
Guzzle\\Service\\Resource\\Model Object([structure:protected] =>[data:protected] => Array([ETag] => "698d51a19d8a121ce581499d7b701668"[VersionId] => MTg0NDUxODMyMTE2ODY0OTExOTk[RequestId] => NWQwOGRkNDdfMjJiMjU4NjRfNzVjXzEwNmVjY2M=[Location] => http://examplebucket-1250000000.cos.ap-chengdu.myqcloud.com/123[CRC] => 16749565679157681890))
参数名称 | 类型 | 描述 | 父节点 |
ETag | String | 上传文件的 MD5 值 | 无 |
VersionId | String | 开启版本控制后,文件的版本号 | 无 |
CRC | String | CRC64 检验码来进行 数据校验 | 无 |
public Guzzle\\Service\\Resource\\Model appendObject(array $args = array());
<?phprequire dirname(__FILE__) . '/../vendor/autoload.php';$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.tencentcloud.com/cos5/bucket$cosClient = new Qcloud\\Cos\\Client(array('region' => $region,'schema' => 'https', //协议头部,默认为http'credentials'=> array('secretId' => $secretId ,'secretKey' => $secretKey)));try {$result = $cosClient->appendObject(array('Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.tencentcloud.com/cos5/bucket'Key' => 'exampleobject','Position' => 0,'Body' => "hello,world",));// 请求成功print_r($result);} catch (\\Exception $e) {// 请求失败echo($e);}
<?phprequire dirname(__FILE__) . '/../vendor/autoload.php';$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.tencentcloud.com/cos5/bucket$cosClient = new Qcloud\\Cos\\Client(array('region' => $region,'schema' => 'https', //协议头部,默认为http'credentials'=> array('secretId' => $secretId ,'secretKey' => $secretKey)));$local_path = "/Users/xxx/Desktop/exampleobject.txt"; //保存到用户本地路径try {$result = $cosClient->appendObject(array('Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.tencentcloud.com/cos5/bucket'Key' => 'exampleobject','Position' => 0,'Body' => fopen($local_path, 'rb'),));// 请求成功print_r($result);} catch (\\Exception $e) {// 请求失败echo($e);}
<?phprequire dirname(__FILE__) . '/../vendor/autoload.php';$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.tencentcloud.com/cos5/bucket$cosClient = new Qcloud\\Cos\\Client(array('region' => $region,'schema' => 'https', //协议头部,默认为http'credentials'=> array('secretId' => $secretId ,'secretKey' => $secretKey)));$local_path = "/Users/xxx/Desktop/exampleobject.txt"; //保存到用户本地路径try {$result = $cosClient->appendObject(array('Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.tencentcloud.com/cos5/bucket'Key' => 'exampleobject','Position' => 0, //追加对象位置'Body' => fopen($local_path, 'rb'),//读取文件内容));$result = $cosClient->appendObject(array('Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.tencentcloud.com/cos5/bucket'Key' => 'exampleobject','Position' => (integer)$result['Position'], //取出上一个追加文件的对象位置进行追加'Body' => "hello, world",));// 请求成功print_r($result);} catch (\\Exception $e) {// 请求失败echo($e);}
参数名称 | 类型 | 描述 | 是否必填 |
Bucket | String | 存储桶名称,格式:BucketName-APPID | 是 |
Key | String | 此处的 Key 为对象键,对象键是对象在存储桶中的唯一标识。例如,在对象的访问域名 examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/doc/pic.jpg 中,对象键为doc/pic.jpg | 是 |
Position | Integer | 追加操作的起始点。首次追加则设置 Position=0,后续追加则设置 Position 为当前 Object 的 content-length | 是 |
Body | File/String | 上传分块的内容,可以为本地文件流或输入流 | 是 |
GuzzleHttp\\Command\\Result Object([ETag] => "9a74ded332531da4c295934ba5a9cf8b"[Position] => 4[RequestId] => NjExNWU4NTlfZDIyZjJjMGJfM2Q2ZV8xMzJjZThhZg==[Key] => exampleobject[Bucket] => examplebucket-1250000000[Location] => examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/exampleobject)
参数名称 | 类型 | 描述 | 父节点 |
ETag | String | 文件的 MD5 值 | 无 |
Position | Integer | 追加操作的起始点 | 无 |
public Guzzle\\Service\\Resource\\Model headObject(array $args = array());
<?phprequire dirname(__FILE__) . '/../vendor/autoload.php';$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.tencentcloud.com/cos5/bucket$cosClient = new Qcloud\\Cos\\Client(array('region' => $region,'schema' => 'https', //协议头部,默认为http'credentials'=> array('secretId' => $secretId ,'secretKey' => $secretKey)));try {$result = $cosClient->headObject(array('Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.tencentcloud.com/cos5/bucket'Key' => 'exampleobject',));// 请求成功print_r($result);} catch (\\Exception $e) {// 请求失败echo($e);}
参数名称 | 类型 | 描述 | 是否必填 |
Bucket | String | 存储桶名称,格式:BucketName-APPID | 是 |
Key | String | 此处的 Key 为对象键,对象键是对象在存储桶中的唯一标识。例如,在对象的访问域名 examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/doc/pic.jpg 中,对象键为doc/pic.jpg | 是 |
VersionId | String | 开启版本控制后,指定文件的具体版本 | 否 |
Guzzle\\Service\\Resource\\Model Object([structure:protected] =>[data:protected] => Array([DeleteMarker] =>[AcceptRanges] =>[Expiration] =>[Restore] =>[LastModified] => Tue, 02 Apr 2019 12:38:09 GMT[ContentLength] => 238186[ETag] => "af9f3b8eaf64473278909183abba1e31"[MissingMeta] =>[VersionId] =>[CacheControl] =>[ContentDisposition] =>[ContentEncoding] =>[ContentLanguage] =>[ContentType] => text/plain; charset=utf-8[Expires] =>[ServerSideEncryption] =>[Metadata] => Array([md5] => af9f3b8eaf64473278909183abba1e31)[SSECustomerAlgorithm] =>[SSECustomerKeyMD5] =>[SSEKMSKeyId] =>[StorageClass] =>[RequestCharged] =>[ReplicationStatus] =>[RequestId] => NWNhMzU3Y2ZfMzFhYzM1MGFfODdhMF8xOTExM2U=[CRC] => 16749565679157681890))
参数名称 | 类型 | 描述 | 父节点 |
CacheControl | String | 缓存策略,设置 Cache-Control | 无 |
ContentDisposition | String | 文件名称,设置 Content-Disposition | 无 |
ContentEncoding | String | 编码格式,设置 Content-Encoding | 无 |
ContentLanguage | String | 语言类型,设置 Content-Language | 无 |
ContentLength | Int | 设置传输长度 | 无 |
ContentType | String | 内容类型,设置 Content-Type | 无 |
Metadata | Array | 用户自定义的文件元信息 | 无 |
StorageClass | String | 文件的存储类型,例如 STANDARD、STANDARD_IA、ARCHIVE。更多存储类型请参见 存储类型概述 | 无 |
ServerSideEncryption | String | 服务端加密方法 | 无 |
ETag | String | 文件的 MD5 值 | 无 |
Restore | String | 归档文件的回热信息 | 无 |
CRC | String | CRC64 检验码来进行 数据校验 | 无 |
public Guzzle\\Service\\Resource\\Model copyObject(array $args = array());
<?phprequire dirname(__FILE__) . '/../vendor/autoload.php';$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.tencentcloud.com/cos5/bucket$cosClient = new Qcloud\\Cos\\Client(array('region' => $region,'schema' => 'https', //协议头部,默认为http'credentials'=> array('secretId' => $secretId ,'secretKey' => $secretKey)));try {$result = $cosClient->copyObject(array('Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.tencentcloud.com/cos5/bucket'Key' => 'exampleobject','CopySource' => 'sourcebucket-1250000000.cos.ap-guangzhou.myqcloud.com/sourceObject',));// 请求成功print_r($result);} catch (\\Exception $e) {// 请求失败echo($e);}
<?phprequire dirname(__FILE__) . '/../vendor/autoload.php';$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.tencentcloud.com/cos5/bucket$cosClient = new Qcloud\\Cos\\Client(array('region' => $region,'schema' => 'https', //协议头部,默认为http'credentials'=> array('secretId' => $secretId ,'secretKey' => $secretKey)));try {$result = $cosClient->copyObject(array('Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.tencentcloud.com/cos5/bucket'Key' => 'exampleobject','CopySource' => 'sourcebucket-1250000000.cos.ap-guangzhou.myqcloud.com/sourceObject?versionId=MTg0NDUxNjI3NTM0ODE2Njc0MzU',));// 请求成功print_r($result);} catch (\\Exception $e) {// 请求失败echo($e);}
<?phprequire dirname(__FILE__) . '/../vendor/autoload.php';$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.tencentcloud.com/cos5/bucket$cosClient = new Qcloud\\Cos\\Client(array('region' => $region,'schema' => 'https', //协议头部,默认为http'credentials'=> array('secretId' => $secretId ,'secretKey' => $secretKey)));try {$result = $cosClient->copyObject(array('Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.tencentcloud.com/cos5/bucket'Key' => 'exampleobject','CopySource' => 'sourcebucket-1250000000.cos.ap-guangzhou.myqcloud.com/sourceObject','StorageClass' => 'Archive'));// 请求成功print_r($result);} catch (\\Exception $e) {// 请求失败echo($e);}
<?phprequire dirname(__FILE__) . '/../vendor/autoload.php';$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.tencentcloud.com/cos5/bucket$cosClient = new Qcloud\\Cos\\Client(array('region' => $region,'schema' => 'https', //协议头部,默认为http'credentials'=> array('secretId' => $secretId ,'secretKey' => $secretKey)));try {$result = $cosClient->copyObject(array('Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.tencentcloud.com/cos5/bucket'Key' => 'exampleobject','CopySource' => 'sourcebucket-1250000000.cos.ap-guangzhou.myqcloud.com/sourceObject','MetadataDirective' => 'Replaced','Metadata' => array('key1' => 'value1','key2' => 'value2',)));// 请求成功print_r($result);} catch (\\Exception $e) {// 请求失败echo($e);}
参数名称 | 类型 | 描述 | 是否必填 |
Bucket | String | 存储桶名称,格式:BucketName-APPID | 是 |
Key | String | 此处的 Key 为对象键,对象键是对象在存储桶中的唯一标识。例如,在对象的访问域名 examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/doc/pic.jpg 中,对象键为doc/pic.jpg | 是 |
CopySource | String | 描述拷贝源文件的路径,包含 Appid、Bucket、Key、Region 例如 examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/doc/pic.jpg | 是 |
MetadataDirective | String | 可选值为 Copy、Replaced。设置为 Copy 时,忽略设置的用户元数据信息直接复制,设置为 Replaced 时,按设置的元信息修改元数据,当目标路径和源路径一样时,必须设置为 Replaced | 否 |
public Guzzle\\Service\\Resource\\Model listMultipartUploads(array $args = array());
<?phprequire dirname(__FILE__) . '/../vendor/autoload.php';$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.tencentcloud.com/cos5/bucket$cosClient = new Qcloud\\Cos\\Client(array('region' => $region,'schema' => 'https', //协议头部,默认为http'credentials'=> array('secretId' => $secretId ,'secretKey' => $secretKey)));try {$result = $cosClient->listMultipartUploads(array('Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.tencentcloud.com/cos5/bucket'Delimiter' => '/','EncodingType' => 'url','KeyMarker' => 'prfixKeyMarker','UploadIdMarker' => 'string','Prefix' => 'prfix','MaxUploads' => 1000,));// 请求成功print_r($result);} catch (\\Exception $e) {// 请求失败echo($e);}
参数名称 | 类型 | 描述 | 是否必填 |
Bucket | String | 存储桶名称,格式:BucketName-APPID | 是 |
Delimiter | String | 默认为空,设置分隔符,例如设置 / 来模拟文件夹 | 否 |
EncodingType | String | 默认不编码,规定返回值的编码方式,可选值:url | 否 |
KeyMarker | String | 标记返回 parts 的 list 的起点位置 | 否 |
UploadIdMarker | String | 标记返回 parts 的 list 的起点位置 | 否 |
Prefix | String | 默认为空,对 parts 的 key 进行筛选,匹配指定前缀(prefix)的 objects | 否 |
MaxUploads | Int | 最多返回的 parts 数量,默认为最大的1000 | 否 |
Guzzle\\Service\\Resource\\Model Object([structure:protected] =>[data:protected] => Array([Bucket] => examplebucket-1250000000[EncodingType] =>[KeyMarker] =>[UploadIdMarker] =>[MaxUploads] => 1000[Prefix] =>[IsTruncated] =>[Uploads] => Array([0] => Array([Key] => exampleobject[UploadId] => 1551693693b1e6d0e00eec30c534059865ec89c9393028b60bfaf167e9420524b25eeb2940[Initiator] => Array([ID] => qcs::cam::uin/100000000001:uin/100000000001[DisplayName] => 100000000001)[Owner] => Array([ID] => qcs::cam::uin/100000000001:uin/100000000001[DisplayName] => 100000000001)[StorageClass] => STANDARD[Initiated] => 2019-03-04T10:01:33.000Z)[1] => Array([Key] => exampleobject[UploadId] => 155374001100563fe0e9d37964d53077e54e9d392bce78f630359cd3288e62acee2b719534[Initiator] => Array([ID] => qcs::cam::uin/100000000001:uin/100000000001[DisplayName] => 100000000001)[Owner] => Array([ID] => qcs::cam::uin/100000000001:uin/100000000001[DisplayName] => 100000000001)[StorageClass] => STANDARD[Initiated] => 2019-03-28T02:26:51.000Z))[RequestId] => NWNhNDJmNzBfZWFhZDM1MGFfMjYyM2FfMWIyNzhh))
参数名称 | 类型 | 描述 | 父节点 |
Bucket | String | 存储桶名称,格式:BucketName-APPID | 无 |
IsTruncated | Int | 表示返回的 objects 否被截断 | 无 |
Uploads | Array | 返回的分块列表 | 无 |
Upload | Array | 返回的分块属性 | Uploads |
Key | String | 对象键 | Upload |
UploadId | String | 对象的分块上传 ID | Upload |
Initiator | String | 初始化该分块的操作者 | Upload |
Owner | String | 分块拥有者 | Upload |
StorageClass | String | 分块的存储类型 | Upload |
Initiated | String | 分块初始化时间 | Upload |
public Guzzle\\Service\\Resource\\Model createMultipartUpload(array $args = array());
<?phprequire dirname(__FILE__) . '/../vendor/autoload.php';$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.tencentcloud.com/cos5/bucket$cosClient = new Qcloud\\Cos\\Client(array('region' => $region,'schema' => 'https', //协议头部,默认为http'credentials'=> array('secretId' => $secretId ,'secretKey' => $secretKey)));try {$result = $cosClient->createMultipartUpload(array('Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.tencentcloud.com/cos5/bucket'Key' => 'exampleobject',));// 请求成功print_r($result);} catch (\\Exception $e) {// 请求失败echo($e);}
参数名称 | 类型 | 描述 | 是否必填 |
Bucket | String | 存储桶名称,格式:BucketName-APPID | 是 |
Key | String | 此处的 Key 为对象键,对象键是对象在存储桶中的唯一标识。例如,在对象的访问域名 examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/doc/pic.jpg 中,对象键为doc/pic.jpg | 是 |
CacheControl | String | 缓存策略,设置 Cache-Control | 否 |
ContentDisposition | String | 文件名称,设置 Content-Disposition | 否 |
ContentEncoding | String | 编码格式,设置 Content-Encoding | 否 |
ContentLanguage | String | 语言类型,设置 Content-Language | 否 |
ContentLength | Int | 设置传输长度 | 否 |
ContentType | String | 内容类型,设置 Content-Type | 否 |
Expires | String | 设置 Content-Expires | 否 |
Metadata | Array | 用户自定义的文件元信息 | 否 |
StorageClass | String | 文件的存储类型,例如 STANDARD、STANDARD_IA、ARCHIVE,默认值:STANDARD。更多存储类型请参见 存储类型概述 | 否 |
ContentMD5 | Boolean | 是否自动生成上传文件的 MD5 值用于校验 | 否 |
ServerSideEncryption | String | 服务端加密方法 | 否 |
Guzzle\\Service\\Resource\\Model Object([structure:protected] =>[data:protected] => Array([Bucket] => examplebucket-1250000000[Key] => exampleobject[UploadId] => 1554277569b3e83df05c730104c325eb7b56000449fb7d51300b0728aacde02a6ea7f6c033[RequestId] => NWNhNDY0YzFfMmZiNTM1MGFfNTM2YV8xYjliMTg=))
参数名称 | 类型 | 描述 | 父节点 |
Bucket | String | 存储桶名称,格式:BucketName-APPID | 无 |
Key | String | 对象键 | 无 |
UploadId | String | 对象分块上传的 ID | 无 |
public Guzzle\\Service\\Resource\\Model uploadPart(array $args = array());
<?phprequire dirname(__FILE__) . '/../vendor/autoload.php';$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.tencentcloud.com/cos5/bucket$cosClient = new Qcloud\\Cos\\Client(array('region' => $region,'schema' => 'https', //协议头部,默认为http'credentials'=> array('secretId' => $secretId ,'secretKey' => $secretKey)));try {$result = $cosClient->uploadPart(array('Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.tencentcloud.com/cos5/bucket'Key' => 'exampleobject','Body' => 'string','UploadId' => 'exampleUploadId', //UploadId 为对象分块上传的 ID,在分块上传初始化的返回参数里获得'PartNumber' => 1, //PartNumber 为分块的序列号,COS 会根据携带序列号合并分块));// 请求成功print_r($result);} catch (\\Exception $e) {// 请求失败echo($e);}
参数名称 | 类型 | 描述 | 是否必填 |
Bucket | String | 存储桶名称,格式:BucketName-APPID | 是 |
Key | String | 对象键 | 是 |
UploadId | String | UploadId 为对象分块上传的 ID,在分块上传初始化的返回参数里获得 | 是 |
Body | File/String | 上传的内容 | 是 |
PartNumber | Int | PartNumber 为分块的序列号,COS 会根据携带序列号合并分块 | 是 |
ContentLength | Int | 设置传输长度 | 否 |
ContentMD5 | Boolean | 是否自动生成上传文件的 MD5 值用于校验 | 否 |
Guzzle\\Service\\Resource\\Model Object([structure:protected] =>[data:protected] => Array([ETag] => "96e79218965eb72c92a549dd5a330112"[RequestId] => NWNhNDdjYWFfNjNhYjM1MGFfMjk2NF8xY2ViMWM=[CRC] => 16749565679157681890))
参数名称 | 类型 | 描述 | 父节点 |
ETag | String | 分块的 MD5 值 | 无 |
CRC | String | CRC64 检验码来进行 数据校验 | 无 |
public Guzzle\\Service\\Resource\\Model listParts(array $args = array());
<?phprequire dirname(__FILE__) . '/../vendor/autoload.php';$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.tencentcloud.com/cos5/bucket$cosClient = new Qcloud\\Cos\\Client(array('region' => $region,'schema' => 'https', //协议头部,默认为http'credentials'=> array('secretId' => $secretId ,'secretKey' => $secretKey)));try {$result = $cosClient->listParts(array('Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.tencentcloud.com/cos5/bucket'Key' => 'exampleobject','UploadId' => 'exampleUploadId','PartNumberMarker' => 1,'MaxParts' => 1000,));// 请求成功print_r($result);} catch (\\Exception $e) {// 请求失败echo($e);}
参数名称 | 类型 | 描述 | 是否必填 |
Bucket | String | 存储桶名称,格式:BucketName-APPID | 是 |
Key | String | 对象键 | 是 |
UploadId | String | 对象分块上传的 ID | 是 |
PartNumberMarker | Int | 标记返回 parts 的 list 的起点位置 | 否 |
MaxParts | Int | 最多返回的 parts 数量,默认最大值为1000 | 否 |
Guzzle\\Service\\Resource\\Model Object([structure:protected] =>[data:protected] => Array([Bucket] => examplebucket-1250000000[Key] => exampleobject[UploadId] => 1554279643cf19d71bb5fb0d29613e5541131f3a96387d9e168cd939c23a3d608c9eb94707[Owner] => Array([ID] => 1250000000[DisplayName] => 1250000000)[PartNumberMarker] => 1[Initiator] => Array([ID] => qcs::cam::uin/100000000001:uin/100000000001[DisplayName] => 100000000001)[StorageClass] => Standard[MaxParts] => 1000[IsTruncated] =>[Parts] => Array([0] => Array([PartNumber] => 2[LastModified] => 2019-04-03T08:21:28.000Z[ETag] => "b948e77469189ac94b98e09755a6dba9"[Size] => 1048576)[1] => Array([PartNumber] => 3[LastModified] => 2019-04-03T08:21:22.000Z[ETag] => "9e5060e2994ec8463bfbebd442fdff16"[Size] => 1048576))[RequestId] => NWNhNDZkNTJfOGNiMjM1MGFfMTRlYl8xYmJiOTU=))
参数名称 | 类型 | 描述 | 父节点 |
Bucket | String | 存储桶名称,格式:BucketName-APPID | 无 |
Key | String | 对象键 | 无 |
UploadId | String | 对象分块上传的 ID | 无 |
IsTruncated | Int | 表示返回的 objects 否被截断 | 无 |
PartNumberMarker | Int | 标记返回 parts 的 list 的起点位置 | 无 |
MaxParts | Int | 最多返回的 parts 数量,默认最大值为1000 | 无 |
Initiator | String | 初始化该分块的操作者 | 无 |
Parts | Array | 返回的分块列表 | 无 |
Part | Array | 返回的分块属性 | Parts |
PartNumber | Int | 分块标号 | Part |
LastModified | String | 分块的最后上传时间 | Part |
ETag | String | 分块的 MD5 值 | Part |
Size | String | 分块的大小 | Part |
public Guzzle\\Service\\Resource\\Model completeMultipartUpload(array $args = array());
<?phprequire dirname(__FILE__) . '/../vendor/autoload.php';$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.tencentcloud.com/cos5/bucket$cosClient = new Qcloud\\Cos\\Client(array('region' => $region,'schema' => 'https', //协议头部,默认为http'credentials'=> array('secretId' => $secretId ,'secretKey' => $secretKey)));try {$result = $cosClient->completeMultipartUpload(array('Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.tencentcloud.com/cos5/bucket'Key' => 'exampleobject','UploadId' => 'exampleUploadId','Parts' => array(array('ETag' => 'exampleETag','PartNumber' => 1,)),// ... repeated));// 请求成功print_r($result);} catch (\\Exception $e) {// 请求失败echo($e);}
参数名称 | 类型 | 描述 | 是否必填 |
Bucket | String | 存储桶名称,格式:BucketName-APPID | 是 |
Key | String | 对象键 | 是 |
UploadId | String | 对象分块上传的 ID | 是 |
Parts | Array | 分块信息列表 | 是 |
Part | Array | 上传分块的内容信息 | 是 |
ETag | String | 分块内容的 MD5 | 是 |
PartNumber | Int | 分块编号 | 是 |
public Guzzle\\Service\\Resource\\Model abortMultipartUpload(array $args = array());
<?phprequire dirname(__FILE__) . '/../vendor/autoload.php';$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.tencentcloud.com/cam/capi$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.tencentcloud.com/cos5/bucket$cosClient = new Qcloud\\Cos\\Client(array('region' => $region,'schema' => 'https', //协议头部,默认为http'credentials'=> array('secretId' => $secretId ,'secretKey' => $secretKey)));try {$result = $cosClient->abortMultipartUpload(array('Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.tencentcloud.com/cos5/bucket'Key' => 'exampleobject','UploadId' => 'exampleUploadId',));// 请求成功print_r($result);} catch (\\Exception $e) {// 请求失败echo($e);}
参数名称 | 类型 | 描述 | 是否必填 |
Bucket | String | 存储桶名称,格式:BucketName-APPID | 是 |
Key | String | 对象键 | 是 |
UploadId | String | 对象分块上传的 ID | 是 |
本页内容是否解决了您的问题?