PutObject (Copy)
    • PDF

    PutObject (Copy)

    • PDF

    Article Summary

    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 NameRequiredTypeRestrictionsDescription
    x-amz-metadata-directiveNoString (COPY 또는 REPLACE)If it is set to REPLACE, the original metadata is replaced by the new metadata.
    x-amz-copy-source-if-matchNoString (ETag)Creates a copy if the specified ETag string matches the source object.
    x-amz-copy-source-if-none-matchNoString (ETag)Creates a copy if the specified ETag string does not match the source object.
    x-amz-copy-source-if-unmodified-sinceNoString (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-sinceNoString (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?

    What's Next
    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.