PutObject (Copy)
- Print
- PDF
PutObject (Copy)
- Print
- PDF
Article Summary
Share feedback
Thanks for sharing your feedback!
Overview
Creates a copy of the object specified with the x-amz-copy-source header by making a PUT request with the specified new object path.
As long as you do not change the copy, its metadata remains the same as that of the source object.
However, the ACL for the account making the request is set to private. No parameters or payload is used for the operation.
Request
Syntax
PUT https://{endpoint}/{bucket-name}/{object-name} # path style
PUT https://{bucket-name}.{endpoint}/{object-name} # virtual host style
Header
Header Name | Required | Type | Restrictions | Description |
---|---|---|---|---|
x-amz-metadata-directive | No | String (COPY 또는 REPLACE) | If it is set to REPLACE, the original metadata is replaced by the new metadata. | |
x-amz-copy-source-if-match | No | String (ETag) | Creates a copy if the specified ETag string matches the source object. | |
x-amz-copy-source-if-none-match | No | String (ETag) | Creates a copy if the specified ETag string does not match the source object. | |
x-amz-copy-source-if-unmodified-since | No | String (timestamp) | Creates a copy if the source object has not been modified since the specified date. It must be in the valid date format (example: Wed, 30 Nov 2016 20:21:38 GMT). | |
x-amz-copy-source-if-modified-since | No | String (timestamp) | Creates a copy if the source object has been modified since the specified date. It must be in the valid date format (example: Wed, 30 Nov 2016 20:21:38 GMT). |
Examples
Request example
The following request gets the bee object from the garden bucket and creates a copy of it with the new key, “wild-bee,” in the example bucket.
PUT /example-bucket/wild-bee HTTP/1.1
Authorization: {authorization-string}
x-amz-date: 20161130T195251Z
x-amz-copy-source: /garden/bee
Host: kr.object.ncloudstorage.com
Response example
HTTP/1.1 200 OK
Date: Wed, 30 Nov 2016 19:52:52 GMT
Accept-Ranges: bytes
x-amz-request-id: 72992a90-8f86-433f-b1a4-7b1b33714bed
ETag: "853aab195ce770b0dfb294a4e9467e62"
Content-Type: application/xml
Content-Length: 240
<CopyObjectResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<LastModified>2016-11-30T19:52:53.125Z</LastModified>
<ETag>"853aab195ce770b0dfb294a4e9467e62"</ETag>
</CopyObjectResult>
Was this article helpful?