PUT /<ObjectKey> HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: GMT Datex-cos-copy-source: <SourceBucketName-SourceAPPID>.cos.<SourceRegion>.myqcloud.com/<SourceObjectKey>Content-Length: 0Authorization: Auth String
名称 | 描述 | 类型 | 是否必选 |
x-cos-copy-source | 源对象的 URL,其中对象键需经过 URLEncode,可以通过 versionId 参数指定源对象的版本,例如: sourcebucket-1250000001.cos.ap-shanghai.myqcloud.com/example-%E8%85%BE%E8%AE%AF%E4%BA%91.jpg 或 sourcebucket-1250000001.cos.ap-shanghai.myqcloud.com/example-%E8%85%BE%E8%AE%AF%E4%BA%91.jpg?versionId=MTg0NDUxNzYzMDc0NDMzNDExOTc | string | 是 |
x-cos-metadata-directive | 是否复制源对象的元数据信息,枚举值:Copy,Replaced,默认为 Copy。 如果标记为 Copy,则复制源对象的元数据信息 如果标记为 Replaced,则按本次请求的请求头中的元数据信息作为目标对象的元数据信息 当目标对象和源对象为同一对象时,即用户试图修改元数据时,则标记必须为 Replaced | Enum | 否 |
x-cos-copy-source-If-Modified-Since | 当对象在指定时间后被修改,则执行复制操作,否则返回 HTTP 状态码为412(Precondition Failed) | string | 否 |
x-cos-copy-source-If-Unmodified-Since | 当对象在指定时间后未被修改,则执行复制操作,否则返回 HTTP 状态码为412(Precondition Failed) | string | 否 |
x-cos-copy-source-If-Match | 当对象的 ETag 与指定的值一致,则执行复制操作,否则返回 HTTP 状态码为412(Precondition Failed) | string | 否 |
x-cos-copy-source-If-None-Match | 当对象的 ETag 与指定的值不一致,则执行复制操作,否则返回 HTTP 状态码为412(Precondition Failed) | string | 否 |
x-cos-storage-class | 目标对象的存储类型。枚举值请参见 存储类型 文档,例如 INTELLIGENT_TIERING,MAZ_INTELLIGENT_TIERING,STANDARD_IA,ARCHIVE,DEEP_ARCHIVE。默认值:STANDARD | Enum | 否 |
x-cos-tagging | 对象的标签集合,最多可设置10个标签(例如,Key1=Value1&Key2=Value2)。 标签集合中的 Key 和 Value 必须先进行 URL 编码 | string | 否 |
x-cos-tagging-directive | 是否复制源对象的标签信息,枚举值:Copy,Replaced,默认为 Copy 如果标记为 Copy,则复制源对象的标签信息 如果标记为 Replaced,则按本次请求的请求头中的标签信息作为目标对象的标签信息 当目标对象和源对象为同一对象时,即用户试图修改对象标签时,则标记必须为 Replaced | Enum | 否 |
x-cos-forbid-overwrite | 针对未开启版本控制的存储桶,上传文件时,用于指定上传操作时是否禁止覆盖同名对象: 不携带 x-cos-forbid-overwrite 头部或指定为 false 时,默认覆盖同名 Object; 指定 x-cos-forbid-overwrite 为 true 时,表示禁止覆盖同名 Object。 注意: 当存储桶处于已开启或已暂停的版本控制状态时,x-cos-forbid-overwrite 请求头部设置无效,即允许覆盖同名对象。 | string | 否 |
名称 | 描述 | 类型 | 是否必选 |
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 | 否 |
x-cos-meta-* | 包括用户自定义元数据头部后缀和用户自定义元数据信息,将作为目标对象元数据保存,大小限制为2KB 例如 x-cos-meta-via: homepage,自定义元数据头部为 x-cos-meta-via,后缀为 via,自定义元数据信息为 homepage 注意:用户自定义元数据信息支持下划线(_),但用户自定义元数据头部后缀不支持下划线,仅支持减号(-) | 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-copy-source-server-side-encryption-customer-algorithm | 服务端加密算法,目前仅支持 AES256 | string | 源对象使用 SSE-C 时,此头部是必选项 |
x-cos-copy-source-server-side-encryption-customer-key | 服务端加密密钥的 Base64 编码,例如 MDEyMzQ1Njc4OUFCQ0RFRjAxMjM0NTY3ODlBQkNERUY= | string | 源对象使用 SSE-C 时,此头部是必选项 |
x-cos-copy-source-server-side-encryption-customer-key-MD5 | 服务端加密密钥的 MD5 哈希值,使用 Base64 编码,例如 U5L61r7jcwdNvT7frmUG8g== | string | 源对象使用 SSE-C 时,此头部是必选项 |
名称 | 描述 | 类型 |
x-cos-copy-source-version-id | 源对象的版本 ID | string |
<?xml version="1.0" encoding="UTF-8"?><CopyObjectResult><ETag>string</ETag><CRC64>number</CRC64><LastModified>date</LastModified><VersionId>string</VersionId></CopyObjectResult>
节点名称(关键字) | 父节点 | 描述 | 类型 |
CopyObjectResult | 无 | 保存 PUT Object - Copy 结果的所有信息 | Container |
节点名称(关键字) | 父节点 | 描述 | 类型 |
ETag | CopyObjectResult | 对象的实体标签(Entity Tag),是对象被创建时标识对象内容的信息标签,可用于检查对象的内容是否发生变化 例如 8e0b617ca298a564c3331da28dcb50df ,此头部并不一定返回对象的 MD5 值,而是根据对象上传和加密方式而有所不同 | string |
CRC64 | CopyObjectResult | number | |
LastModified | CopyObjectResult | 对象最后修改时间,为 ISO8601 格式,例如 2019-05-24T10:56:40Z | date |
VersionId | CopyObjectResult | 对象的版本 ID,仅当目标存储桶启用了版本控制时才返回该元素 | string |
PUT /exampleobject HTTP/1.1Host: destinationbucket-1250000000.cos.ap-beijing.myqcloud.comDate: Fri, 10 Apr 2020 18:20:30 GMTx-cos-copy-source: sourcebucket-1250000001.cos.ap-shanghai.myqcloud.com/example-%E8%85%BE%E8%AE%AF%E4%BA%91.jpgContent-Length: 0Authorization: q-sign-algorithm=sha1&q-ak=AKID8A0fBVtYFrNm02oY1g1JQQF0c3JO****&q-sign-time=1586542830;1586550030&q-key-time=1586542830;1586550030&q-header-list=content-length;date;host;x-cos-copy-source&q-url-param-list=&q-signature=f91b02809317616d993e14625996e416e08e****Connection: close
HTTP/1.1 200 OKContent-Type: application/xmlContent-Length: 219Connection: closeDate: Fri, 10 Apr 2020 18:20:30 GMTServer: tencent-cosx-cos-request-id: NWU5MGI4ZWVfNzljMDBiMDlfMWM3MjlfMWQ1****<?xml version="1.0" encoding="UTF-8"?><CopyObjectResult><ETag>"ee8de918d05640145b18f70f4c3aa602"</ETag><CRC64>16749565679157681890</CRC64><LastModified>2020-04-10T18:20:30Z</LastModified></CopyObjectResult>
PUT /exampleobject HTTP/1.1Host: destinationbucket-1250000000.cos.ap-beijing.myqcloud.comDate: Fri, 10 Apr 2020 18:20:41 GMTx-cos-metadata-directive: ReplacedContent-Type: application/octet-streamContent-Disposition: attachment; filename=example.jpgx-cos-copy-source: sourcebucket-1250000001.cos.ap-shanghai.myqcloud.com/example-%E8%85%BE%E8%AE%AF%E4%BA%91.jpgContent-Length: 0Authorization: q-sign-algorithm=sha1&q-ak=AKID8A0fBVtYFrNm02oY1g1JQQF0c3JO****&q-sign-time=1586542841;1586550041&q-key-time=1586542841;1586550041&q-header-list=content-disposition;content-length;content-type;date;host;x-cos-copy-source;x-cos-metadata-directive&q-url-param-list=&q-signature=aa2522c12b0ac82e29a812fca4334705cc96****Connection: close
HTTP/1.1 200 OKContent-Type: application/xmlContent-Length: 219Connection: closeDate: Fri, 10 Apr 2020 18:20:41 GMTServer: tencent-cosx-cos-request-id: NWU5MGI4ZjlfYTZjMDBiMDlfN2Y1YV8xYjI4****<?xml version="1.0" encoding="UTF-8"?><CopyObjectResult><ETag>"ee8de918d05640145b18f70f4c3aa602"</ETag><CRC64>16749565679157681890</CRC64><LastModified>2020-04-10T18:20:41Z</LastModified></CopyObjectResult>
PUT /exampleobject HTTP/1.1Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.comDate: Fri, 10 Apr 2020 18:20:52 GMTx-cos-metadata-directive: ReplacedCache-Control: max-age=86400Content-Type: image/jpegx-cos-copy-source: examplebucket-1250000000.cos.ap-beijing.myqcloud.com/exampleobjectContent-Length: 0Authorization: q-sign-algorithm=sha1&q-ak=AKID8A0fBVtYFrNm02oY1g1JQQF0c3JO****&q-sign-time=1586542852;1586550052&q-key-time=1586542852;1586550052&q-header-list=cache-control;content-length;content-type;date;host;x-cos-copy-source;x-cos-metadata-directive&q-url-param-list=&q-signature=1bcab704e474e46359d97c8c1fbb93642069****Connection: close
HTTP/1.1 200 OKContent-Type: application/xmlContent-Length: 219Connection: closeDate: Fri, 10 Apr 2020 18:20:52 GMTServer: tencent-cosx-cos-request-id: NWU5MGI5MDRfNmRjMDJhMDlfZGNmYl8yMDVh****<?xml version="1.0" encoding="UTF-8"?><CopyObjectResult><ETag>"ee8de918d05640145b18f70f4c3aa602"</ETag><CRC64>16749565679157681890</CRC64><LastModified>2020-04-10T18:20:52Z</LastModified></CopyObjectResult>
PUT /exampleobject HTTP/1.1Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.comDate: Fri, 10 Apr 2020 18:21:02 GMTx-cos-metadata-directive: Replacedx-cos-storage-class: ARCHIVEx-cos-copy-source: examplebucket-1250000000.cos.ap-beijing.myqcloud.com/exampleobjectContent-Length: 0Authorization: q-sign-algorithm=sha1&q-ak=AKID8A0fBVtYFrNm02oY1g1JQQF0c3JO****&q-sign-time=1586542862;1586550062&q-key-time=1586542862;1586550062&q-header-list=content-length;date;host;x-cos-copy-source;x-cos-metadata-directive;x-cos-storage-class&q-url-param-list=&q-signature=8726a359b342cb1cace6945812ee8379c3ad****Connection: close
HTTP/1.1 200 OKContent-Type: application/xmlContent-Length: 219Connection: closeDate: Fri, 10 Apr 2020 18:21:02 GMTServer: tencent-cosx-cos-request-id: NWU5MGI5MGVfN2RiNDBiMDlfMTk1MjhfMWZm****<?xml version="1.0" encoding="UTF-8"?><CopyObjectResult><ETag>"ee8de918d05640145b18f70f4c3aa602"</ETag><CRC64>16749565679157681890</CRC64><LastModified>2020-04-10T18:21:55Z</LastModified></CopyObjectResult>
PUT /exampleobject HTTP/1.1Host: destinationbucket-1250000000.cos.ap-beijing.myqcloud.comDate: Fri, 10 Apr 2020 18:21:12 GMTx-cos-server-side-encryption: AES256x-cos-copy-source: sourcebucket-1250000001.cos.ap-shanghai.myqcloud.com/example-%E8%85%BE%E8%AE%AF%E4%BA%91.jpgContent-Length: 0Authorization: q-sign-algorithm=sha1&q-ak=AKID8A0fBVtYFrNm02oY1g1JQQF0c3JO****&q-sign-time=1586542872;1586550072&q-key-time=1586542872;1586550072&q-header-list=content-length;date;host;x-cos-copy-source;x-cos-server-side-encryption&q-url-param-list=&q-signature=ee94ef60dfb512882b368be12c6d47526433****Connection: close
HTTP/1.1 200 OKContent-Type: application/xmlContent-Length: 219Connection: closeDate: Fri, 10 Apr 2020 18:21:13 GMTServer: tencent-cosx-cos-request-id: NWU5MGI5MTlfYmIwMmEwOV9hMmUxXzFkMDQ2****x-cos-server-side-encryption: AES256<?xml version="1.0" encoding="UTF-8"?><CopyObjectResult><ETag>"ee8de918d05640145b18f70f4c3aa602"</ETag><CRC64>16749565679157681890</CRC64><LastModified>2020-04-10T18:21:13Z</LastModified></CopyObjectResult>
PUT /exampleobject HTTP/1.1Host: destinationbucket-1250000000.cos.ap-beijing.myqcloud.comDate: Fri, 10 Apr 2020 18:21:23 GMTx-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=x-cos-copy-source: sourcebucket-1250000001.cos.ap-shanghai.myqcloud.com/example-%E8%85%BE%E8%AE%AF%E4%BA%91.jpgContent-Length: 0Authorization: q-sign-algorithm=sha1&q-ak=AKID8A0fBVtYFrNm02oY1g1JQQF0c3JO****&q-sign-time=1586542883;1586550083&q-key-time=1586542883;1586550083&q-header-list=content-length;date;host;x-cos-copy-source;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=28055a7cf07d7dde858fd924d6c0963b0c68****Connection: close
HTTP/1.1 200 OKContent-Type: application/xmlContent-Length: 219Connection: closeDate: Fri, 10 Apr 2020 18:21:23 GMTServer: tencent-cosx-cos-request-id: NWU5MGI5MjNfMTliOTJhMDlfMjRiYThfMTdk****x-cos-server-side-encryption: cos/kmsx-cos-server-side-encryption-cos-kms-key-id: 48ba38aa-26c5-11ea-855c-52540085****<?xml version="1.0" encoding="UTF-8"?><CopyObjectResult><ETag>"f69901ec9755a5defc29057e9ec69126"</ETag><CRC64>16749565679157681890</CRC64><LastModified>2020-04-10T18:22:16Z</LastModified></CopyObjectResult>
PUT /exampleobject HTTP/1.1Host: destinationbucket-1250000000.cos.ap-beijing.myqcloud.comDate: Fri, 10 Apr 2020 18:21:44 GMTx-cos-copy-source-server-side-encryption-customer-algorithm: AES256x-cos-copy-source-server-side-encryption-customer-key: MDEyMzQ1Njc4OUFCQ0RFRjAxMjM0NTY3ODlBQkNERUY=x-cos-copy-source-server-side-encryption-customer-key-MD5: U5L61r7jcwdNvT7frmUG8g==x-cos-server-side-encryption-customer-algorithm: AES256x-cos-server-side-encryption-customer-key: MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWY=x-cos-server-side-encryption-customer-key-MD5: hRasmdxgYDKV3nvbahU1MA==x-cos-copy-source: sourcebucket-1250000001.cos.ap-shanghai.myqcloud.com/example-%E8%85%BE%E8%AE%AF%E4%BA%91.jpgContent-Length: 0Authorization: q-sign-algorithm=sha1&q-ak=AKID8A0fBVtYFrNm02oY1g1JQQF0c3JO****&q-sign-time=1586542904;1586550104&q-key-time=1586542904;1586550104&q-header-list=content-length;date;host;x-cos-copy-source;x-cos-copy-source-server-side-encryption-customer-algorithm;x-cos-copy-source-server-side-encryption-customer-key;x-cos-copy-source-server-side-encryption-customer-key-md5;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=dece274320f748bb0c736b13e5409cd1c35f****Connection: close
HTTP/1.1 200 OKContent-Type: application/xmlContent-Length: 219Connection: closeDate: Fri, 10 Apr 2020 18:21:44 GMTServer: tencent-cosx-cos-request-id: NWU5MGI5MzhfZmFjODJhMDlfMTdlYzZfYmU1****x-cos-server-side-encryption-customer-algorithm: AES256x-cos-server-side-encryption-customer-key-MD5: hRasmdxgYDKV3nvbahU1MA==<?xml version="1.0" encoding="UTF-8"?><CopyObjectResult><ETag>"bf314b89d34119395d5610982d6581b1"</ETag><CRC64>16749565679157681890</CRC64><LastModified>2020-04-10T18:22:31Z</LastModified></CopyObjectResult>
PUT /exampleobject HTTP/1.1Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.comDate: Fri, 10 Apr 2020 18:22:05 GMTx-cos-metadata-directive: Replacedx-cos-copy-source-server-side-encryption-customer-algorithm: AES256x-cos-copy-source-server-side-encryption-customer-key: MDEyMzQ1Njc4OUFCQ0RFRjAxMjM0NTY3ODlBQkNERUY=x-cos-copy-source-server-side-encryption-customer-key-MD5: U5L61r7jcwdNvT7frmUG8g==x-cos-copy-source: examplebucket-1250000000.cos.ap-beijing.myqcloud.com/exampleobjectContent-Length: 0Authorization: q-sign-algorithm=sha1&q-ak=AKID8A0fBVtYFrNm02oY1g1JQQF0c3JO****&q-sign-time=1586542925;1586550125&q-key-time=1586542925;1586550125&q-header-list=content-length;date;host;x-cos-copy-source;x-cos-copy-source-server-side-encryption-customer-algorithm;x-cos-copy-source-server-side-encryption-customer-key;x-cos-copy-source-server-side-encryption-customer-key-md5;x-cos-metadata-directive&q-url-param-list=&q-signature=b57bc8f6d666e9d722d30ad7d3ab442d9c43****Connection: close
HTTP/1.1 200 OKContent-Type: application/xmlContent-Length: 219Connection: closeDate: Fri, 10 Apr 2020 18:22:05 GMTServer: tencent-cosx-cos-request-id: NWU5MGI5NGRfOWFjOTJhMDlfMjg2NDdfMTA0****<?xml version="1.0" encoding="UTF-8"?><CopyObjectResult><ETag>"ee8de918d05640145b18f70f4c3aa602"</ETag><CRC64>16749565679157681890</CRC64><LastModified>2020-04-10T18:22:58Z</LastModified></CopyObjectResult>
PUT /exampleobject HTTP/1.1Host: destinationbucket-1250000000.cos.ap-beijing.myqcloud.comDate: Sat, 11 Apr 2020 17:51:35 GMTx-cos-copy-source: sourcebucket-1250000001.cos.ap-shanghai.myqcloud.com/example.jpg?versionId=MTg0NDUxNTc0NDYyMjQ2MzUzMjQContent-Length: 0Authorization: q-sign-algorithm=sha1&q-ak=AKID8A0fBVtYFrNm02oY1g1JQQF0c3JO****&q-sign-time=1586627495;1586634695&q-key-time=1586627495;1586634695&q-header-list=content-length;date;host;x-cos-copy-source&q-url-param-list=&q-signature=da80bd079b2c1fdb0dd961dea8568ee8d998****Connection: close
HTTP/1.1 200 OKContent-Type: application/xmlContent-Length: 219Connection: closeDate: Sat, 11 Apr 2020 17:51:35 GMTServer: tencent-cosx-cos-copy-source-version-id: MTg0NDUxNTc0NDYyMjQ2MzUzMjQx-cos-request-id: NWU5MjAzYTdfMWZjMDJhMDlfNTE4N18zNGU2****<?xml version="1.0" encoding="UTF-8"?><CopyObjectResult><ETag>"ee8de918d05640145b18f70f4c3aa602"</ETag><CRC64>16749565679157681890</CRC64><LastModified>2020-04-11T17:51:35Z</LastModified></CopyObjectResult>
PUT /exampleobject HTTP/1.1Host: destinationbucket-1250000000.cos.ap-beijing.myqcloud.comDate: Sat, 11 Apr 2020 17:51:56 GMTx-cos-copy-source: sourcebucket-1250000001.cos.ap-shanghai.myqcloud.com/example.jpgContent-Length: 0Authorization: q-sign-algorithm=sha1&q-ak=AKID8A0fBVtYFrNm02oY1g1JQQF0c3JO****&q-sign-time=1586627516;1586634716&q-key-time=1586627516;1586634716&q-header-list=content-length;date;host;x-cos-copy-source&q-url-param-list=&q-signature=2c79d63b6078ace6fc9430fb6533b9a9ade1****Connection: close
HTTP/1.1 200 OKContent-Type: application/xmlContent-Length: 272Connection: closeDate: Sat, 11 Apr 2020 17:51:56 GMTServer: tencent-cosx-cos-request-id: NWU5MjAzYmNfNjRiMDJhMDlfOTE3N18yYWI4****<?xml version="1.0" encoding="UTF-8"?><CopyObjectResult><ETag>"22e024392de860289f0baa7d6cf8a549"</ETag><CRC64>11596229263574363878</CRC64><LastModified>2020-04-11T17:51:56Z</LastModified><VersionId>MTg0NDUxNTc0NDYxOTI4MzU0MDI</VersionId></CopyObjectResult>
本页内容是否解决了您的问题?