PutObject

Prev Next

Available in Classic and VPC

Upload an object and create metadata.
If you upload an already saved object again, it will be overwritten, and if you recreate existing metadata, it will be updated with the newly entered values.

Requests

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

Method URI
PUT /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
X-Object-Meta-{name} String Optional Metadata to set
  • Enter the key for the metadata in the {name} part
  • Enter the metadata value in the header value
X-Object-Manifest String Conditional When uploading large objects, the manifest of the object (SLO)
  • Input format: {container}/{prefix}
X-Delete-At Integer Optional Scheduled time for automatic deletion of the object (Unix timestamp)
  • Use when you want to temporarily store data
  • It deletes the object at the entered date and time
X-Delete-After Integer Optional When to delete the object automatically (enter in seconds)
  • Use when you want to temporarily store data
  • It deletes the object after the entered time from the time of upload
X-Detect-Content-Type Boolean Optional Automatically set the MIME type of the object based on the file extension
  • true | false
    • true: Detect and automatically determine the MIME type
    • false: Set to the MIME type entered in Content-Type without auto-detection
X-Copy-From String Optional Copy the object
  • Input format: {container}/{object}
  • Can be combined with the Range header
X-Copy-From-Account String Optional Copy the object to another account
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
Content-Length Integer Optional Object capacity
  • No setup required when using chunked transfer encoding
Transfer-Encoding String Optional Set up chunked transfer encoding
  • chunked
  • Need to exclude the Content-Length header when setting up
ETag String Optional ETag header value
If-None-Match String Optional ETag condition header

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 object to save

Request query parameters

The following describes the parameters.

Field Type Required Description
temp_url_sig String Optioanl Signature of a temporary URL to access the resource to be stored
  • Validate that the request is authorized
temp_url_expires Integer Optioanl Expiration time for the temporary URL to access the resource to be stored (Unix timestamp)
multipart-manifest String Conditional Declare a multipart upload of a large object
  • Entering put as a value is recognized as a multipart upload and tells the server to assemble the parts into a single file
  • Must create a manifest for the part combination in the request body

Request example

The following is a sample request.

curl -L -X PUT 'https://kr.archive.ncloudstorage.com/v1/AUTH_{project_id}/{container}/{object}' \
-H 'X-Auth-Token: {token}' \
-H 'X-Object-Meta-collection: C1' \
-H 'X-Detect-Content-Type: true' \
-T '@{/FILE_PATH/OBJECT}'

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-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 of the request (UTC)

Response status codes

The following describes the response status codes.

HTTP status code Code Message Description
201 - Created Request succeeded
408 - Request Timeout Request timeout

Response example

The following is a sample response.

HTTP/1.1 201 Created
Last-Modified: Mon, 17 Sep 2018 07:36:47 GMT
Content-Length: 0
Etag: 95444a08aec383972a52eaaac43e6dce
Content-Type: text/html; charset=UTF-8
X-Trans-Id: txe5ad93db05334b1cb44d2-005b9f598e
X-Openstack-Request-Id: txe5ad93db05334b1cb44d2-005b9f598e
Date: Mon, 17 Sep 2018 07:36:46 GMT