/
实现,例如将 picture.png 上传到 doc 文件夹,则对象键设置为 doc/picture.png;如需创建文件夹 doc,则对象键设置为 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]
名称 | 描述 | 类型 | 是否必选 |
Cache-Control | RFC 2616 中定义的缓存指令,将作为对象元数据保存 | string | 否 |
Content-Disposition | RFC 2616 中定义的文件名称,将作为对象元数据保存 | string | 否 |
Content-Encoding | RFC 2616 中定义的编码格式,将作为对象元数据保存 | string | 否 |
Content-Type | RFC 2616 中定义的 HTTP 请求内容类型(MIME),此头部用于描述待上传对象的内容类型,将作为对象元数据保存。 例如 text/html 或image/jpeg | string | 是 |
Expires | RFC 2616 中定义的缓存失效时间,将作为对象元数据保存 | string | 否 |
Transfer-Encoding | 如果希望在上传时分块传输,则指定 Transfer-Encoding: chunked 请求头部,此时请求体遵循 RFC 2616 中定义的传输编码格式,且不能指定 Content-Length 请求头部 | string | 否 |
x-cos-meta-* | 包括用户自定义元数据头部后缀和用户自定义元数据信息,将作为对象元数据保存,大小限制为2KB 注意:用户自定义元数据信息支持下划线(_),但用户自定义元数据头部后缀不支持下划线,仅支持减号(-) | string | 否 |
x-cos-storage-class | 对象存储类型。枚举值请参见 存储类型概述 文档,例如 MAZ_STANDARD,MAZ_STANDARD_IA,INTELLIGENT_TIERING,MAZ_INTELLIGENT_TIERING,STANDARD_IA,ARCHIVE,DEEP_ARCHIVE。默认值:STANDARD | enum | 否 |
x-cos-traffic-limit | 针对本次上传进行流量控制的限速值,必须为数字,单位默认为 bit/s。限速值设置范围为819200 - 838860800,即800Kb/s - 800Mb/s,如果超出该范围将返回400错误 | integer | 否 |
x-cos-tagging | 对象的标签集合,最多可设置10个标签(例如,Key1=Value1&Key2=Value2)。 标签集合中的 Key 和 Value 必须先进行 URL 编码。 | string | 否 |
x-cos-forbid-overwrite | 针对未开启版本控制的存储桶,上传文件时,用于指定上传操作时是否禁止覆盖同名对象: 不携带 x-cos-forbid-overwrite 头部或指定为 false 时,默认覆盖同名 Object; 指定 x-cos-forbid-overwrite 为 true 时,表示禁止覆盖同名 Object。 注意: 当存储桶处于已开启或已暂停的版本控制状态时,x-cos-forbid-overwrite 请求头部设置无效,即允许覆盖同名对象。 | string | 否 |
名称 | 描述 | 类型 | 是否必选 |
x-cos-acl | 注意:如果您不需要进行对象 ACL 控制,请设置为 default 或者此项不进行设置,默认继承存储桶权限 | enum | 否 |
x-cos-grant-read | 赋予被授权者读取对象的权限,格式为 id="[OwnerUin]",例如 id="100000000001",可使用半角逗号(,)分隔多组被授权者,例如 id="100000000001",id="100000000002" | string | 否 |
x-cos-grant-read-acp | 赋予被授权者读取对象的访问控制列表(ACL)的权限,格式为 id="[OwnerUin]",例如 id="100000000001",可使用半角逗号(,)分隔多组被授权者,例如 id="100000000001",id="100000000002" | string | 否 |
x-cos-grant-write-acp | 赋予被授权者写入对象的访问控制列表(ACL)的权限,格式为 id="[OwnerUin]",例如 id="100000000001",可使用半角逗号(,)分隔多组被授权者,例如 id="100000000001",id="100000000002" | string | 否 |
x-cos-grant-full-control | 赋予被授权者操作对象的所有权限,格式为 id="[OwnerUin]",例如 id="100000000001",可使用半角逗号(,)分隔多组被授权者,例如 id="100000000001",id="100000000002" | string | 否 |
名称 | 描述 | 类型 |
x-cos-version-id | 对象的版本 ID | 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=AKID8A0fBVtYFrNm02oY1g1JQQF0c3JO****&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=c4147d4d457869a49b13e8e936c06a12c809****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=AKID8A0fBVtYFrNm02oY1g1JQQF0c3JO****&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=20d0cd79060cec8c560ebd239738626726f4****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=AKID8A0fBVtYFrNm02oY1g1JQQF0c3JO****&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=35145bc61ae490c4959b58bc6d27b3258bf7****Connection: close[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=AKID8A0fBVtYFrNm02oY1g1JQQF0c3JO****&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=6cb5d6f0137bb1d87f5afe98c5289b0de375****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=AKID8A0fBVtYFrNm02oY1g1JQQF0c3JO****&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=4f6f9f0a6700930f70bff31e3a2b2e622711****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=AKID8A0fBVtYFrNm02oY1g1JQQF0c3JO****&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=371f555ec81751e1dbf38927e568af4cc67a****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=AKID8A0fBVtYFrNm02oY1g1JQQF0c3JO****&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=0747f6508fca37dfb5c91bbe3fa01f91b326****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=AKID8A0fBVtYFrNm02oY1g1JQQF0c3JO****&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=0b05b6bda75afbc159caa0da4e4051ec6939****Connection: close11[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.1Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.comx-cos-object-lock-retain-until-date: 2022-12-30T10:30:09.000Zx-cos-object-lock-mode: COMPLIANCE[Object Content]
HTTP/1.1 200 OKContent-Length: 0Connection: closeDate: Fri, 10 Apr 2020 09:35:05 GMTETag: "ee8de918d05640145b18*****"Server: tencent-cosx-cos-hash-crc64ecma: 167495656791****x-cos-request-id: NWU5MDNkYzlfNjRiODJhMDlfMzFmYz********
本页内容是否解决了您的问题?