After a multipart upload task is created, you can upload parts for this task using the obtained multipart upload ID. When parts are uploaded in a multipart upload of an object, the upload sequence does not affect part merging, namely, multiple parts can be uploaded concurrently.
Ensure that the part size ranges from 100 KB to 5 GB and the size of the last part ranges from 0 to 5 GB. Otherwise, an error will be reported when you assemble parts. The upload part ID ranges from 1 to 10,000.
This operation supports server-side encryption.
The value of partNumber in a multipart task is unique. If you upload a part of the same partNumber repeatedly, the last part uploaded will overwrite the previous one. When multiple concurrent uploading of the same partNumber part of the same object is performed, the Last Write Win policy is applied. The time of Last Write is defined as the time when the metadata of the part is created. To ensure data accuracy, the client must be locked to ensure concurrent upload of the same part of the same object. Concurrent upload of different parts of the same object does not need to be locked.
PUT /ObjectName?partNumber=partNum&uploadId=uploadID HTTP/1.1 Host: bucketname.obs.region.example.com Date: date Content-Length: length Authorization: authorization Content-MD5:md5 <object Content>
This request uses parameters to specify the upload task ID and part number. Table 1 describes the parameters.
Parameter |
Type |
Mandatory (Yes/No) |
Description |
|---|---|---|---|
partNumber |
Integer |
Yes |
Definition: Indicates the ID of a part to be uploaded. Constraints: None Range: An integer ranging from 1 to 10000. Default value: None |
uploadId |
String |
Yes |
Definition: Indicates a multipart upload ID. Constraints: None Range: None Default value: None |
This request uses common headers. For details, see Table 3.
Header |
Type |
Mandatory (Yes/No) |
Description |
|---|---|---|---|
x-obs-server-side-encryption-customer-algorithm |
String |
No. This header is required when SSE-C is used. The encryption algorithm must be the same as that used to initiate multipart upload tasks. |
Definition: The algorithm used for encryption. Example: x-obs-server-side-encryption-customer-algorithm:AES256 Constraints:
Range: AES256 Default value: None |
x-obs-server-side-encryption-customer-key |
String |
No. This header is required when SSE-C is used. The key must be the same as that used to initiate multipart upload tasks. |
Definition: The key used for encrypting an object. Example: x-obs-server-side-encryption-customer-key:K7QkYpBkM5+hca27fsNkUnNVaobncnLht/rCB2o/9Cw= Constraints:
Range: None Default value: None |
x-obs-server-side-encryption-customer-key-MD5 |
String |
No. This header is required when SSE-C is used. The MD5 value must be the same as that used to initiate multipart upload tasks. |
Definition: The MD5 value of the encryption key. The MD5 value is used to check whether any error occurs during the transmission of the key. Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ== Constraints: This header is used only when SSE-C is used for encryption. This header is a Base64-encoded 128-bit MD5 value and must be used together with x-obs-server-side-encryption-customer-algorithm and x-obs-server-side-encryption-customer-key. Range: Base64-encoded MD5 value of the key ID. Default value: None |
x-obs-request-payer |
String |
No |
Definition: Indicates that the requester agrees to pay for the request and traffic. Constraints: If this header is not included in the request when the requester tries to access a requester-pays bucket, the authentication fails and error "403 Forbidden" is returned. Range: requester Default value: None |
This request involves no elements.
1 2 3 4 | HTTP/1.1 status_code Date: date ETag: etag Content-Length: length |
The response to the request uses common headers. For details, see Table 1.
Header |
Type |
Description |
|---|---|---|
x-obs-server-side-encryption |
String |
Definition: The encryption method used by the server. Example: x-obs-server-side-encryption:kms Constraints: This header is included in a response if SSE-KMS is used. Range:
Default value: None |
x-obs-server-side-encryption-kms-key-id |
String |
Definition: ID of a specified key used for SSE-KMS encryption. Constraints: This header can only be used when you specify kms for the x-obs-server-side-encryption header. Default value: If you specify kms for encryption but do not specify a key ID, the default master key will be used. If there is not a default master key, OBS will create one and use it. |
x-obs-sse-kms-key-project-id |
String |
Definition: If SSE-KMS encryption is used with a custom master key, the ID of the project (not enterprise project) to which the custom master key belongs is returned. Range: ID of the project (not enterprise project) to which the custom master key specified by x-obs-server-side-encryption-kms-key-id belongs |
x-obs-server-side-encryption-customer-algorithm |
String |
Definition: The algorithm used for encryption. Example: x-obs-server-side-encryption-customer-algorithm:AES256 Constraints: This header is included in a response if SSE-C is used for server-side encryption. Range: AES256 Default value: None |
x-obs-server-side-encryption-customer-key-MD5 |
String |
Definition: The MD5 value of the encryption key. Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ== Constraints: This header is included in a response if SSE-C is used for server-side encryption. Range: Base64-encoded MD5 value of the key ID. Default value: None |
x-obs-request-payer |
string |
Definition: Indicates that the requester agrees to pay for the request and traffic. Constraints: If this header is not included in the request when the requester tries to access a requester-pays bucket, the authentication fails and error "403 Forbidden" is returned. Range: requester Default value: None |
This response contains no elements.
Other errors are included in Table 2.
PUT /object02?partNumber=1&uploadId=00000163D40171ED8DF4050919BD02B8 HTTP/1.1 User-Agent: curl/7.29.0 Host: examplebucket.obs.region.example.com Accept: */* Date: WED, 01 Jul 2015 05:15:55 GMT Authorization: OBS H4IPJX0TQTHTHEBQQCEC:ZB0hFwaHubi1aKHv7dSZjJts40g= Content-Length: 102015348 [102015348 Byte part content]
1 2 3 4 5 6 7 | HTTP/1.1 200 OK Server: OBS x-obs-request-id: 8DF400000163D40956A703289CA066F1 ETag: "b026324c6904b2a9cb4b88d6d61c81d1" x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCUQu/EOEVSMa04GXVwy0z9WI+BsDKvfh Date: WED, 01 Jul 2015 05:15:55 GMT Content-Length: 0 |