/.{"version": "2.0","statement": [{"action": ["name/cos:PutObject"],"effect": "allow","resource": ["qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/doc/*"]}]}
PUT /<ObjectKey> HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: GMT DateContent-Type: Content TypeContent-Length: Content LengthContent-MD5: MD5Authorization: Auth String[Object Content]
Name | Description | Type | Required or Optional |
Cache-Control | Cache directives defined in RFC 2616 will be saved as object metadata. | string | No |
Content-Disposition | The file name defined in RFC 2616 will be saved as object metadata. For example: inline: Preview file content directly. attachment: Download to the browser-specified path in the form of the original file name. attachment; filename="FileName": Download to the browser-specified path in the form of a custom file name. FileName is used for customizing the downloaded file name, for example example.jpg. | string | No |
Content-Encoding | The encoding format defined in RFC 2616 will be saved as object metadata. | string | No |
Content-Type | The HTTP request content type (MIME) defined in RFC 2616. This header is for description of the content type of the uploaded object and will be saved as object metadata. For example, application/xml or image/jpeg. | string | Yes |
Expires | Cache expiration time defined in RFC 2616 is an absolute date and time, saved as object metadata. | string | No |
Transfer-Encoding | The transfer encoding format defined in RFC 2616. If you want to use chunked transfer during upload, specify the Transfer-Encoding: chunked request header. You cannot specify the Content-Length request header. | string | No |
Name | Description | Type | Required or Optional |
x-cos-meta-[custom suffix] | Custom metadata headers. For example x-cos-meta-test: test metadata.Note: Custom metadata headers follow the fixed format x-cos-meta-[custom suffix]. Among them, the custom suffix supports minus signs (-), digits, and English letters (a–z). Uppercase letters in English characters will be converted to lowercase letters. Other characters, including underscores (_), are not supported.- There is no limit on the number of custom metadata headers. Each header has a size limit of 2KB, and the total size of all x-cos-meta-[custom suffix] headers must be no more than 4KB. | string | No |
x-cos-storage-class | Storage type. Default value: STANDARD. For enumeration values, see the storage type overview document. Reference values: STANDARD: standard storage STANDARD_IA: infrequent storage ARCHIVE: archive storage DEEP_ARCHIVE: deep archive storage MAZ_STANDARD: standard storage (multi-AZ) MAZ_STANDARD_IA: infrequent storage (multi-AZ) INTELLIGENT_TIERING: intelligent tiering storage MAZ_INTELLIGENT_TIERING: intelligent tiering storage (multi-AZ) | enum | No |
x-cos-traffic-limit | The rate-limiting value for traffic control targeting this upload must be a number, with a default unit of bit/s. The speed limit setting range is 819200 - 838860800 (800Kb/s - 800Mb/s). If outside of this range, it will return a 400 error. | integer | No |
x-cos-tagging | The tag set of an object supports up to 10 tags (for example, Key1=Value1&Key2=Value2). Keys and values in the tag set must first perform URL encoding. | string | No |
x-cos-forbid-overwrite | For buckets with versioning not enabled, when uploading files, used to specify whether to forbid overwriting objects with the same name during upload operation: When the x-cos-forbid-overwrite header is not included or set to false, default overwrite applies if an Object with the same name already exists. Set x-cos-forbid-overwrite to true to forbid overwriting an Object with the same name. Note: When the bucket is in enabled or paused versioning status, the x-cos-forbid-overwrite request header setting is invalid, allowing overwriting objects with the same name. | string | No |
Name | Description | Type | Required or Optional |
x-cos-acl | Define the access control list (ACL) property of the object. Default is default. For enumeration values, see the preset ACL part of the object in the ACL overview document. Reference values: default: inherit permissions private: private read/write public-read: public read/private write Note: If you do not need to control object ACL, set it to default or leave this item unset. Permissions are inherited from the bucket by default. | enum | No |
x-cos-grant-read | Grant the read permission of the object to the authorized person. Format: id="[OwnerUin]", for example id="100000000001". Use a comma (half-width) to separate multiple authorized entities, such as id="100000000001",id="100000000002". | string | No |
x-cos-grant-read-acp | Grant the authorized entities permission to read the object's access control list (ACL). Format: id="[OwnerUin]", for example id="100000000001". Use a comma (half-width) to separate multiple authorized entities, such as id="100000000001",id="100000000002". | string | No |
x-cos-grant-write-acp | Grant the authorized entities permission to write to the object's access control list (ACL). Format: id="[OwnerUin]", for example id="100000000001". Use a comma (half-width) to separate multiple authorized entities, such as id="100000000001",id="100000000002". | string | No |
x-cos-grant-full-control | Grant all privileges on the operation object to the authorized entities. Format: id="[OwnerUin]", for example id="100000000001". Use a comma (half-width) to separate multiple authorized entities, such as id="100000000001",id="100000000002". | string | No |
Name | Description | Type |
x-cos-version-id | Version ID of an object. | string |
PUT /exampleobject HTTP/1.1Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.comDate: Fri, 10 Apr 2020 09:35:05 GMTContent-Type: image/jpegContent-Length: 16Content-MD5: 7o3pGNBWQBRbGPcPTDqmAg==Authorization: q-sign-algorithm=sha1&q-ak=************************************&q-sign-time=1586511305;1586518505&q-key-time=1586511305;1586518505&q-header-list=content-length;content-md5;content-type;date;host&q-url-param-list=&q-signature=****************************************Connection: close[Object Content]
HTTP/1.1 200 OKContent-Length: 0Connection: closeDate: Fri, 10 Apr 2020 09:35:05 GMTETag: "ee8de918d05640145b18f70f4c3aa602"Server: tencent-cosx-cos-hash-crc64ecma: 16749565679157681890x-cos-request-id: NWU5MDNkYzlfNjRiODJhMDlfMzFmYzhfMTFm****
PUT /exampleobject HTTP/1.1Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.comDate: Fri, 10 Apr 2020 09:35:28 GMTContent-Type: image/jpegCache-Control: max-age=86400Content-Disposition: attachment; filename=example.jpgx-cos-meta-example-field: example-valuex-cos-acl: public-readContent-Length: 16Content-MD5: 7o3pGNBWQBRbGPcPTDqmAg==Authorization: q-sign-algorithm=sha1&q-ak=************************************&q-sign-time=1586511328;1586518528&q-key-time=1586511328;1586518528&q-header-list=cache-control;content-disposition;content-length;content-md5;content-type;date;host;x-cos-acl;x-cos-meta-example-field&q-url-param-list=&q-signature=****************************************Connection: close[Object Content]
HTTP/1.1 200 OKContent-Length: 0Connection: closeDate: Fri, 10 Apr 2020 09:35:28 GMTETag: "ee8de918d05640145b18f70f4c3aa602"Server: tencent-cosx-cos-hash-crc64ecma: 16749565679157681890x-cos-request-id: NWU5MDNkZTBfZjhjMDBiMDlfNzdmN18xMGFi****
PUT /exampleobject HTTP/1.1Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.comDate: Fri, 10 Apr 2020 09:35:49 GMTContent-Type: image/jpegx-cos-server-side-encryption: AES256Content-Length: 16Content-MD5: 7o3pGNBWQBRbGPcPTDqmAg==Authorization: q-sign-algorithm=sha1&q-ak=************************************&q-sign-time=1586511349;1586518549&q-key-time=1586511349;1586518549&q-header-list=content-length;content-md5;content-type;date;host;x-cos-server-side-encryption&q-url-param-list=&q-signature=****************************************[Object Content]
HTTP/1.1 200 OKContent-Length: 0Connection: closeDate: Fri, 10 Apr 2020 09:35:49 GMTETag: "ee8de918d05640145b18f70f4c3aa602"Server: tencent-cosx-cos-hash-crc64ecma: 16749565679157681890x-cos-request-id: NWU5MDNkZjVfYzVjNzJhMDlfMjVhNzNfMWMy****x-cos-server-side-encryption: AES256
PUT /exampleobject HTTP/1.1Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.comDate: Fri, 10 Apr 2020 09:36:00 GMTContent-Type: image/jpegx-cos-server-side-encryption: cos/kmsx-cos-server-side-encryption-cos-kms-key-id: 48ba38aa-26c5-11ea-855c-52540085****x-cos-server-side-encryption-context: eyJhdXRob3IiOiJmeXNudGlhbiIsImNvbXBhbnkiOiJUZW5jZW50In0=Content-Length: 16Content-MD5: 7o3pGNBWQBRbGPcPTDqmAg==Authorization: q-sign-algorithm=sha1&q-ak=************************************&q-sign-time=1586511360;1586518560&q-key-time=1586511360;1586518560&q-header-list=content-length;content-md5;content-type;date;host;x-cos-server-side-encryption;x-cos-server-side-encryption-context;x-cos-server-side-encryption-cos-kms-key-id&q-url-param-list=&q-signature=****************************************Connection: close[Object Content]
HTTP/1.1 200 OKContent-Length: 0Connection: closeDate: Fri, 10 Apr 2020 09:36:01 GMTETag: "840af7c921f4b3230049af8663145bd0"Server: tencent-cosx-cos-hash-crc64ecma: 16749565679157681890x-cos-request-id: NWU5MDNlMDFfOThjMjJhMDlfMjhhMl8xNTlm****x-cos-server-side-encryption: cos/kmsx-cos-server-side-encryption-cos-kms-key-id: 48ba38aa-26c5-11ea-855c-52540085****
PUT /exampleobject HTTP/1.1Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.comDate: Fri, 10 Apr 2020 09:36:12 GMTContent-Type: image/jpegx-cos-server-side-encryption-customer-algorithm: AES256x-cos-server-side-encryption-customer-key: MDEyMzQ1Njc4OUFCQ0RFRjAxMjM0NTY3ODlBQkNERUY=x-cos-server-side-encryption-customer-key-MD5: U5L61r7jcwdNvT7frmUG8g==Content-Length: 16Content-MD5: 7o3pGNBWQBRbGPcPTDqmAg==Authorization: q-sign-algorithm=sha1&q-ak=************************************&q-sign-time=1586511372;1586518572&q-key-time=1586511372;1586518572&q-header-list=content-length;content-md5;content-type;date;host;x-cos-server-side-encryption-customer-algorithm;x-cos-server-side-encryption-customer-key;x-cos-server-side-encryption-customer-key-md5&q-url-param-list=&q-signature=****************************************Connection: close[Object Content]
HTTP/1.1 200 OKContent-Length: 0Connection: closeDate: Fri, 10 Apr 2020 09:36:13 GMTETag: "582d9105f71525f3c161984bc005efb5"Server: tencent-cosx-cos-hash-crc64ecma: 16749565679157681890x-cos-request-id: NWU5MDNlMGNfZTFjODJhMDlfMzVlMDFfZTk1****x-cos-server-side-encryption-customer-algorithm: AES256x-cos-server-side-encryption-customer-key-MD5: U5L61r7jcwdNvT7frmUG8g==
PUT /exampleobject HTTP/1.1Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.comDate: Fri, 10 Apr 2020 09:36:34 GMTContent-Type: image/jpegContent-Length: 16Content-MD5: 7o3pGNBWQBRbGPcPTDqmAg==Authorization: q-sign-algorithm=sha1&q-ak=************************************&q-sign-time=1586511394;1586518594&q-key-time=1586511394;1586518594&q-header-list=content-length;content-md5;content-type;date;host&q-url-param-list=&q-signature=****************************************Connection: close[Object Content]
HTTP/1.1 200 OKContent-Length: 0Connection: closeDate: Fri, 10 Apr 2020 09:36:35 GMTETag: "ee8de918d05640145b18f70f4c3aa602"Server: tencent-cosx-cos-hash-crc64ecma: 16749565679157681890x-cos-request-id: NWU5MDNlMjNfMThiODJhMDlfNGQ1OF8xMWY4****x-cos-version-id: MTg0NDUxNTc1NjIzMTQ1MDAwODg
PUT /exampleobject HTTP/1.1Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.comDate: Fri, 10 Apr 2020 09:37:07 GMTContent-Type: image/jpegContent-Length: 16Content-MD5: 7o3pGNBWQBRbGPcPTDqmAg==Authorization: q-sign-algorithm=sha1&q-ak=************************************&q-sign-time=1586511427;1586518627&q-key-time=1586511427;1586518627&q-header-list=content-length;content-md5;content-type;date;host&q-url-param-list=&q-signature=****************************************Connection: close[Object Content]
HTTP/1.1 200 OKContent-Length: 0Connection: closeDate: Fri, 10 Apr 2020 09:37:07 GMTETag: "ee8de918d05640145b18f70f4c3aa602"Server: tencent-cosx-cos-hash-crc64ecma: 16749565679157681890x-cos-request-id: NWU5MDNlNDNfZTZjNzJhMDlfMmYwMDlfMTVi****
PUT /exampleobject HTTP/1.1Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.comDate: Thu, 08 Aug 2019 09:15:29 GMTContent-Type: text/plainTransfer-Encoding: chunkedAuthorization: q-sign-algorithm=sha1&q-ak=************************************&q-sign-time=1565255729;1565262929&q-key-time=1565255729;1565262929&q-header-list=content-type;date;host;transfer-encoding&q-url-param-list=&q-signature=****************************************11[Chunked Content]b[2nd chunk]b[3rd chunk]b[4th chunk]0
HTTP/1.1 200 OKContent-Length: 0Connection: closeDate: Thu, 08 Aug 2019 09:15:29 GMTETag: "aa488bb80185a6be87f4a7b936a80752"Server: tencent-cosx-cos-hash-crc64ecma: 7188322482464764960x-cos-request-id: NWQ0YmU4MzFfNzFiNDBiMDlfMWJhYTlfMTY2Njll****
PUT /exampleobject HTTP/1.1x-cos-forbid-overwrite: trueHost: examplebucket-1250000000.cos.ap-beijing.myqcloud.comDate: Fri, 10 Apr 2020 09:37:07 GMTContent-Type: image/jpegContent-Length: 16Content-MD5: 7o3pGNBWQBRbGPcPTDqmAg==Authorization: q-sign-algorithm=sha1&q-ak=************************************&q-sign-time=1586511427;1586518627&q-key-time=1586511427;1586518627&q-header-list=content-length;content-md5;content-type;date;host&q-url-param-list=&q-signature=****************************************Connection: close[Object Content]
HTTP/1.1 200 OKContent-Length: 0Connection: closeDate: Fri, 10 Apr 2020 09:37:07 GMTETag: "aa488bb80185a6be87f4a7b936a80752"Server: tencent-cosx-cos-hash-crc64ecma: 7188322482464764960x-cos-request-id: NWQ0YmU4MzFfNzFiNDBiMDlfMWJhYTlfMTY2Njll****
HTTP/1.1 409 ConflictContent-Length: 417Content-Type: application/xmlDate: Fri, 10 Apr 2020 09:37:07 GMTServer: tencent-cosx-cos-request-id: NjgyZDUwYWVfYzkyZGI1MDlfZDki*****x-cos-trace-id: OGVmYzZiMmQzYjA2OWNhODk0NTRkMTBiOWVmMDAxO*******<?xml version='1.0' encoding='utf-8' ?><Error><Code>FileAlreadyExists</Code><Message>File already exists.</Message><Resource>/exampleobject</Resource><RequestId>NjgyZDUwYWVfYzkyZGI1MDlfZDk3NV8*****</RequestId><TraceId>OGVmYzZiMmQzYjA2OWNhODk0NTRkMTBiOWV****</TraceId></Error>
SDK | Documentation Link |
Android SDK | |
C SDK | |
C++ SDK | |
.NET(C#) SDK | |
Flutter SDK | |
Go SDK | |
iOS SDK | |
Java SDK | |
JavaScript SDK | |
Node.js SDK | |
PHP SDK | |
Python SDK | |
React Native SDK | |
Mini Program SDK |
Feedback