PUT Object (Copy)

Creates a copy of an existing object in a storage system bucket. This operation is equivalent to issuing a GET Object operation followed by a PUT Object operation on the same object, but to a different bucket.

By default, ACL permissions of the original object are not applied to the copied object. The x-amz-acl header allows you to specify a new ACL when you issue a PUT Object (Copy) operation.

Request syntax

PUT /destinationObject HTTP/1.1
Host: destinationBucket.rs2.StorageService.com
x-amz-copy-source: /source_bucket/sourceObject
x-amz-metadata-directive: metadata_directive
x-amz-copy-source-if-match: etag
x-amz-copy-source-if-none-match: etag
x-amz-copy-source-if-unmodified-since: time_stamp
x-amz-copy-source-if-modified-since: time_stamp
<request metadata>
Authorization: signatureValue
Date: date

Request headers

The PUT Object (Copy) operation and accepts the following request headers:
Authorization, Content-Length, Content-Type, Date, Host, x-amz-acl, x-amz-metadata-directive, x-amz-copy-source, x-amz-copy-source-if-match, x-amz-copy-source-if-none-match, x-amz-copy-source-if-unmodified-since, and x-amz-copy-source-if-modified-since.

The Authorization, Date, Host, and x-amz-copy-source headers are required; all others are optional. For more information about supported request headers, see Request Headers.

Response headers

The PUT Object (Copy) operation may include the following response headers: Content-Length, Connection, Date, ETag, and Server. 

For more information about supported response headers, see Response Headers.

Response elements

The PUT Object (Copy) operation uses the following response elements (element datatypes in parentheses):

Examples

Request sample

This sample makes a copy of an mp4 file:

PUT /videocopy/claymores.mp4 HTTP/1.1
Host: demo.cloud.it
Authorization: AWS pat:EFiO0gjSO4NDRGPayElJbPTFtHI=
Date: Tue, 21 Jun 2011 13:13:14 GMT.
x-amz-copy-source:/video/claymores.mp4
Response sample
HTTP/1.1 200 OK
Date: Tue, 21 Jun 2011 13:14:12 GMT
Server: RestServer/1.0
Content-Length: 189
Content-Type: application/xml
ETag: "8155e6997d855411090e08df634b9250"
Cache-Control: no-cache
Connection: close

<?xml version="1.0" encoding="UTF-8"?>
<CopyObjectResult>
   <LastModified>2011-06-21T13:14:12.000Z</LastModified>
   <ETag>&quot;8155e6997d855411090e08df634b9250&quot;</ETag>
</CopyObjectResult>