Last update:2025-08-25 16:19:37
This API is used to create a copy of an object that already exists on Object Storage.The IAM permission wos:PutObject is required.
x-wos-copy-source to request header, you can move copy of the object to destination bucket by PUT method.x-wos-copy-source-if-match, x-wos-copy- source-if-none-match, x-wos-copy-source-if-unmodified-since, x-wos-copy-source-if-modified-since.PUT /destinationObjectName HTTP/1.1
Host: Bucket.Endpoint
x-wos-copy-source: /sourceBucket/sourceObject
x-wos-copy-source-if-match: etag
x-wos-copy-source-if-none-match: etag
x-wos-copy-source-if-unmodified-since: time_stamp
x-wos-meta-*:metainfo
Authorization: Authorization string
Date: date
None.
Except the Common Request Headers , you can also use the following headers:
| Header | Description | Required |
|---|---|---|
| x-wos-copy-source | Specify the source bucket and source object name. This header must be URL encoded. Type: String Example: x-wos-copy-source:/src_bucket/src_object | Yes |
| x-wos-copy-source-if-match | TOnly when value of x-wos-copy-source-if-none-match matches etag of the source object will the object copy operation be performed, otherwise 412 ( precondition failed ) will be returned. Type: String. Example: x-wos-copy-source-if-match: etag Constraint: This parameter can not be used together with other parameters, except x-wos-copy-source-if-unmodified/modified-since. |
No |
| x-wos-copy-source-if-none-match | Only when value of x-wos-copy-source-if-none-match does not match etag of the source object will the object copy operation be performed, otherwise 412 ( precondition failed ) will be returned. Type: String. Example: x-wos-copy-source-if-none-match: etag |
No |
| x-wos-copy-source-if-unmodified-since | Only when the source object has not been modified after the time specified by this parameter, will the copy object operation be performed, otherwise 412 ( precondition failed ) will be returned. This parameter can not be used together with other parameters, except x-wos-copy-source-if-match.Type: HTTP time string formatExample: x-wos-copy-source-if-unmodified -since: timestamp |
No |
| x-wos-copy-source-if-modified-since | Only when the source object has been modified during the time specified by this parameter, will the copy object operation be performed, otherwise 412 ( precondition failed ) will be returned. This parameter can not be used together with other parameters, except x-wos-copy-source-if-none-match.Type: HTTP time string formatExample: x-wos-copy-source-if-modified-since: time-stamp |
No |
| x-wos-metadata-directive | Specifies whether to replace the target object’s metadata with the metadata provided in x-wos-meta-* (REPLACE), or to only copy the source object’s metadata without replacement (COPY).Type: String. Example: x-wos-metadata-directive : COPY |
No |
| x-wos-meta-* | Customized metadata, which will be be returned in header of headObject and getObjectType.Type: String. Example: x-wos-metadata-abc : test |
No |
None.
HTTP/1.1 status_code
x-wos-request-id: request id
Content-Type: type
Date: date
Content-Length: length
Server: WS-web-server
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<CopyObjectResult xmlns=" http://wcs.chinanetcenter.com/document">
<LastModified>modifiedDate</LastModified>
<ETag>etagValue</ETag>
</CopyObjectResult>
Please use Common Response Headers .
| Name | Description |
|---|---|
| CopyObjectResult | Container of the copy. Type : XML |
| LastModified | The last modification time of the object. Type: String |
| ETag | The ETag value of the new object.Type : String |
Special errors
| Situation | HTTP Status | Error Code | Message |
|---|---|---|---|
| Format error, such as missing copy object | 400 Bad Request | InvalidArgument | Copy Source must mention the source bucket and key: sourcebucket/sourcekey |
| Copied object is larger than 5 GB | 400 Bad Request | EntityTooLarge | Your proposed copy exceeds the maximum allowed object size. |
| The source bucket and object name are identical to the destination bucket and object name(Copying an object to itself without changing metadata) | 400 Bad Request | InvalidRequest | This copy request is illegal because it is trying to copy an object to itself without changing the object’s metadata attribute. |
PUT /destobject HTTP/1.1
Host: bucket.s3-cn-east-1.wcsapi.com
Date: Sat, 03 Dec 2011 08:48:07 +0000
Authorization: WOS BF6C09F302931425E9A7:2rZR+iaH8xUewvUKuicLhLHpNoU=
x-wos-copy-source: /srcbucket/srcobject
HTTP/1.1 200 OK
x-wos-request-id: 318BC8BC148832E5
Date: Wed, 28 Oct 2009 22:32:00 GMT
Connection: close
Server: WS-Web-Server
<CopyObjectResult>
<LastModified>2009-10-28T22:32:00</LastModified>
<ETag>"9b2cf535f27731c974343645a3985328"</ETag>
</CopyObjectResult>