Create object PUT /v1/{account}/{container}/{object}{?multipart-manifest}
Creates an object using the specified content and metadata or replaces an existing object with the specified content and metadata.
When this operation is used to copy a manifest object, the new object becomes a normal object with all segments joined. Therefore, it is not possible to copy an object that has a combined size exceeding 5 GB.
When creation of an object is successful, the 201 Created status code is returned.
When a request times out, the 408 Request Timeout error code is returned.
If neither Transfer-Encoding nor Content-Length request header are specified, the 411 Length Required error code is returned.
If the value set for ETag and the MD5 checksum of the data do not match, the 422 Unprocessable Entity error code is returned.
Request headers
X-Object-Manifest
Sets the manifest object of a dynamic large object. This value takes the container name and prefix name of the split object as follows: {container}/{prefix}. Also, it is necessary for the container name and prefix name of the split object to be UTF-8-encoded as well as URL-encoded before being set in the header.
Data Type | Cardinality |
---|---|
String | 0..1 |
X-Auth-Token
Authentication token
Data Type | Cardinality |
---|---|
String | 1..1 |
Content-Length
Size of object (bytes). This item cannot be set if transferring in chunked format.
Data Type | Cardinality |
---|---|
String | 0..1 |
Transfer-Encoding
If transferring in chunked format, use Transfer-Encoding: chunked. If using this header, a Content-Length header cannot be assigned.
Data Type | Cardinality |
---|---|
String | 0..1 |
Content-Type
Changes the MIME type of an object.
Data Type | Cardinality |
---|---|
String | 0..1 |
X-Detect-Content-Type
When "true" is set, the object storage will automatically set the MIME type based on the file extension. Settings using the Content-Type header will be ignored.
Data Type | Cardinality |
---|---|
Boolean | 0..1 |
X-Copy-From
Specifies the copy source object name.
This value is specified in {container}/{object} format.
Also, it is necessary for this value to be UTF-8-encoded as well as URL-encoded before being set in the header.
A PUT operation using the X-Copy-From header is the same as performing a COPY operation.
Data Type | Cardinality |
---|---|
String | 0..1 |
ETag
MD5 checksum of the request body. For example, an MD5 checksum of the files to be uploaded. In order to perform full uploads, it is strongly recommended to calculate the M5 checksum of the object in advance, set it for this header and issue the request. This value is not to be enclosed in quotation marks.
Data Type | Cardinality |
---|---|
String | 0..1 |
Content-Disposition
Sets the browser behavior.
Refer to "http://www.ietf.org/rfc/rfc2183.txt" for details on the value to set.
Data Type | Cardinality |
---|---|
String | 0..1 |
Content-Encoding
Sets the Content-Encoding metadata.
Data Type | Cardinality |
---|---|
String | 0..1 |
X-Delete-At
Specify the date on which an object should be deleted in UNIX Epoch timestamp format.
Data Type | Cardinality |
---|---|
Int | 0..1 |
X-Delete-After
Specify the number of seconds until an object is deleted. This value is converted to X-Delete-At in the object storage.
Data Type | Cardinality |
---|---|
Int | 0..1 |
X-Object-Meta-name
Object metadata {name} is the name of the metadata item.
Data Type | Cardinality |
---|---|
String | 0..* |
If-None-Match
Expect: Use in combination with 100-Continue. This is used to check if the server is holding a cache of the data already specified in the header.
Data Type | Cardinality |
---|---|
String | 0..1 |
Request Parameter
{account}
Name uniquely assigned by project
Data Type | Cardinality |
---|---|
String | 1..1 |
{container}
Container name
Data Type | Cardinality |
---|---|
String | 1..1 |
{object}
Object name
Data Type | Cardinality |
---|---|
String | 1..1 |
multipart-manifest
When ?multipart-manifest=put is specified, the object is uploaded as the manifest of a static large object. The request body includes a description of the manifest.
Data Type | Cardinality |
---|---|
String | 0..1 |
Response Headers
Content-Length
Number of bytes of the response body
Data Type | Cardinality |
---|---|
String | 1..1 |
ETag
When an object is smaller than 5 GB, this value will be the MD5 checksum of the uploaded object. This value is not to be enclosed in quotation marks.
When an ETag header is assigned and the PUT operation is successful for the request, this value will be the same as the specified ETag.
Also, when an ETag header has not been assigned, check if this value is the same as the ETag value of the object that was uploaded.
In the case of a static large object, a value with the retrieved MD5 checksum for a string that combines the ETag and MD5 checksums of each segment of the manifest is returned.
In the case of a dynamic large object, this value will be the MD5 checksum of a null character.
Data Type | Cardinality |
---|---|
String | 1..1 |
Content-Type
MIME type of an object
Data Type | Cardinality |
---|---|
String | 1..1 |
X-Trans-Id
ID assigned to this request. This is used when inquiring about issues.
Data Type | Cardinality |
---|---|
Uuid | 1..1 |
Date
Datetime when the transaction was executed
Data Type | Cardinality |
---|---|
Datetime | 1..1 |
Response Elements
None
Example of Request
curl -i $publicURL/janeausten/helloworld.txt -X PUT -H "Content-Length: 1" -H "Content-Type: text/html; charset=UTF-8" -H "X-Auth-Token: $token"
Example of Response
HTTP/1.1 201 Created
Last-Modified: Fri, 17 Jan 2014 17:28:35 GMT
Content-Length: 116
Etag: d41d8cd98f00b204e9800998ecf8427e
Content-Type: text/html; charset=UTF-8
X-Trans-Id: tx4d5e4f06d357462bb732f-0052d96843
Date: Fri, 17 Jan 2014 17:28:35 GMT