릴리스 노트
제품 공지
try {$result = $cosClient->putObject(array('Bucket' => 'examplebucket-125000000', //형식:BucketName-APPID'Key' => 'exampleobject''Body' => 'string','ServerSideEncryption' => 'AES256',//SSE-COS 암호화),);print_r ($result);} catch (Qcloud\\Cos\\Exception\\ServiceResponseException $e) {echo $e;}
SSE 관련 헤더 필드 설정을 통해 이를 완료합니다.require 'vendor/autoload.php';$secretId = "SECRETID"; //"Tencent Cloud API 키 SecretId";$secretKey = "SECRETKEY"; //"Tencent Cloud API 키 SecretKey";$region = "ap-beijing"; //기본 버킷 리전 설정$cosClient = new Qcloud\\Cos\\Client(array('region' => $region,'schema' => 'https', //프로토콜 헤더, 기본값: http, SSE-C는 반드시 https 프로토콜 사용'credentials'=> array('secretId' => $secretId ,'secretKey' => $secretKey)));$bucket = 'examplebucket-125000000'; //형식: BucketName-APPID$key = 'exampleobject';try {$customerKey = 'abcdefghijklmnopqrstuvwxyz123456'; //32 바이트의 문자열입니다. 숫자, 알파벳, 문자 조합을 지원하지만 중국어는 지원하지 않습니다.$SSECustomerKey = base64_encode($customerKey);$SSECustomerKeyMd5 = base64_encode(md5($customerKey, true));$result = $cosClient->putObject(array('Bucket' => $bucket,'Key' => $key,'Body' => 'string','SSECustomerAlgorithm' => 'AES256','SSECustomerKey' => $SSECustomerKey,'SSECustomerKeyMD5' => $SSECustomerKeyMd5,));print_r ($result);} catch (Qcloud\\Cos\\Exception\\ServiceResponseException $e) {echo $e;}
피드백