PutObject
    • PDF

    PutObject

    • PDF

    Article summary

    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.

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

    Request headers

    The following describes the headers.

    FieldTypeRequiredDescription
    X-Auth-TokenStringOptionalValue of the issued token
    X-Object-Meta-{name}StringOptionalMetadata to set
    • Enter the key for the metadata in the {name} part
    • Enter the metadata value in the header value
    X-Object-ManifestStringConditionalWhen uploading large objects, the manifest of the object (SLO)
    • Input format: {container}/{prefix}
    X-Delete-AtIntegerOptionalScheduled 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-AfterIntegerOptionalWhen 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-TypeBooleanOptionalAutomatically 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-FromStringOptionalCopy the object
    • Input format: {container}/{object}
    • Can be combined with the Range header
    X-Copy-From-AccountStringOptionalCopy the object to another account
    Content-DispositionStringOptionalBrowser's response handling method
    Content-EncodingStringOptionalObject's encoding method
    Content-TypeStringOptionalObject's MIME type
    Content-LengthIntegerOptionalObject capacity
    • No setup required when using chunked transfer encoding
    Transfer-EncodingStringOptionalSet up chunked transfer encoding
    • chunked
    • Need to exclude the Content-Length header when setting up
    ETagStringOptionalETag header value
    If-None-MatchStringOptionalETag condition header

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

    Request query parameters

    The following describes the parameters.

    FieldTypeRequiredDescription
    temp_url_sigStringOptioanlSignature of a temporary URL to access the resource to be stored
    • Validate that the request is authorized
    temp_url_expiresIntegerOptioanlExpiration time for the temporary URL to access the resource to be stored (Unix timestamp)
    multipart-manifestStringConditionalDeclare 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.

    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-Trans-IdString-Transaction ID of the request
    X-Openstack-Request-IdString-Transaction ID of the request
    • Identical to X-Trans-Id
    DateString-Response time of the request (UTC)

    Response status codes

    The following describes the response status codes.

    HTTP status codeCodeMessageDescription
    201-CreatedRequest succeeded
    408-Request TimeoutRequest 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
    

    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.