CopyObject
    • PDF

    CopyObject

    • PDF

    Article summary

    Available in Classic and VPC

    Duplicate and upload an object from another location.

    Requests

    The following describes the request format for the endpoint. The request format is as follows.

    MethodURI
    COPY/v1/AUTH_{project_id}/{container}/{object}

    Request headers

    The following describes the headers.

    FieldTypeRequiredDescription
    X-Auth-TokenStringOptionalValue of the issued token
    DestinationStringRequiredPath to save the copy
    • Input format: {container}/{object}
    X-Object-Meta-{name}StringOptionalMetadata to set
    • Enter the key of the metadata in the {name} part
    • Enter the metadata value for the header value
    • Metadata can be added, updated, and deleted
    • Set to empty when requesting deletion
    X-Fresh-MetadataBooleanOptionalWhether to copy metadata
    • true | false (default)
      • true: metadata not copied
      • false: metadata copied
    Content-DispositionStringOptionalBrowser's response handling method
    Content-EncodingStringOptionalObject's encoding method
    Content-TypeStringOptionalObject's MIME type

    Request path parameters

    The following describes the parameters.

    FieldTypeRequiredDescription
    project_idStringRequiredProject ID
    containerStringRequiredName of the container where the target object will be stored
    objectStringRequiredName of the target object to copy

    Request query parameters

    The following describes the parameters.

    FieldTypeRequiredDescription
    multipart-manifestStringConditionalDeclare a multipart upload of a large object
    • Entering get as a value is recognized as a multipart upload
    • The manifest is copied, not the object itself

    Request example

    The following is a sample request.

    curl -L -X COPY 'https://kr.archive.ncloudstorage.com/v1/AUTH_{project_id}/{container}/{object}' \
    -H 'X-Auth-Token: {token}' \
    -H 'X-Object-Meta-collection: C5' \
    -H 'Destination: {container}/{object name}' \
    -H 'X-Fresh-Metadata: true'
    

    Responses

    The following describes the response format.

    Response headers

    The following describes the headers.

    FieldTypeRequiredDescription
    Content-TypeString-MIME type of the response result
    Content-LengthString-Length of the response result (bytes)
    ETagString-ETag header value
    Last-ModifiedString-Most recent modification time of the object (UTC)
    X-Copied-From-AccountString-Account of the source object (project ID)
    X-Copied-FromString-Path of the source object
    • Format: {container}/{object}
    X-Copied-From-Last-ModifiedString-Last-Modified header value of the source object
    X-Object-Meta-{name}String-Object metadata
    • {name} part is the metadata's key
    • Header value is the metadata value
    X-Trans-IdString-Transaction ID of the request
    X-Openstack-Request-IdString-Transaction ID of the request
    • Identical to X-Trans-Id
    DateString-Response time for the request (UTC)

    Response status codes

    The following describes the response status codes.

    HTTP status codeCodeMessageDescription
    201-CreatedRequest succeeded

    Response example

    The following is a sample response.

    HTTP/1.1 201 Created
    Last-Modified: Mon, 17 Sep 2018 08:21:36 GMT
    Content-Length: 0
    Etag: f1c9645dbc14efddc7d8a322685f26eb
    Content-Type: text/html; charset=UTF-8
    X-Copied-From-Account: AUTH_{project_id}
    X-Copied-From-Last-Modified: Mon, 17 Sep 2018 07:43:40 GMT
    X-Copied-From: ncloud-container-0/ncloud-object-0
    X-Trans-Id: tx851b895d7fcf47f987a5a-005b9f640f
    X-Openstack-Request-Id: tx851b895d7fcf47f987a5a-005b9f640f
    Date: Mon, 17 Sep 2018 08:21:35 GMT
    

    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.