CopyObject

Prev Next

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.

Method URI
COPY /v1/AUTH_{project_id}/{container}/{object}

Request headers

The following describes the headers.

Field Type Required Description
X-Auth-Token String Optional Value of the issued token
Destination String Required Path to save the copy
  • Input format: {container}/{object}
X-Object-Meta-{name} String Optional Metadata 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-Metadata Boolean Optional Whether to copy metadata
  • true | false (default)
    • true: metadata not copied
    • false: metadata copied
Content-Disposition String Optional Browser's response handling method
Content-Encoding String Optional Object's encoding method
Content-Type String Optional Object's MIME type

Request path parameters

The following describes the parameters.

Field Type Required Description
project_id String Required Project ID
container String Required Name of the container where the target object will be stored
object String Required Name of the target object to copy

Request query parameters

The following describes the parameters.

Field Type Required Description
multipart-manifest String Conditional Declare 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.

Field Type Required Description
Content-Type String - MIME type of the response result
Content-Length String - Length of the response result (bytes)
ETag String - ETag header value
Last-Modified String - Most recent modification time of the object (UTC)
X-Copied-From-Account String - Account of the source object (project ID)
X-Copied-From String - Path of the source object
  • Format: {container}/{object}
X-Copied-From-Last-Modified String - 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-Id String - Transaction ID of the request
X-Openstack-Request-Id String - Transaction ID of the request
  • Identical to X-Trans-Id
Date String - Response time for the request (UTC)

Response status codes

The following describes the response status codes.

HTTP status code Code Message Description
201 - Created Request 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