After initiating a multipart upload, you can use this operation to upload parts for the multipart upload using its task 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.
Part sizes range from 100 KB to 5 GB. However, when parts are being merged, the size of the last uploaded part ranges from 0 to 5 GB. 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.
This request uses common headers. For details, see Table 3.
Header |
Description |
Mandatory |
---|---|---|
x-obs-server-side-encryption-customer-algorithm |
Indicates an encryption algorithm. The header is used in SSE-C mode. Type: string Example: x-obs-server-side-encryption-customer-algorithm:AES256 Constraint: This header must be used together with x-obs-server-side-encryption-customer-key and x-obs-server-side-encryption-customer-key-MD5. |
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. |
x-obs-server-side-encryption-customer-key |
Indicates a key used to encrypt objects. The header is used in SSE-C mode. This key is used to encrypt objects. Type: string Example: x-obs-server-side-encryption-customer-key:K7QkYpBkM5+hca27fsNkUnNVaobncnLht/rCB2o/9Cw= Constraint: This header is a Base64-encoded 256-bit key and must be used together with x-obs-server-side-encryption-customer-algorithm and x-obs-server-side-encryption-customer-key-MD5. |
No. This header is required when SSE-C is used. The key must be the same as that used to initiate multipart upload tasks. |
x-obs-server-side-encryption-customer-key-MD5 |
Indicates the MD5 value of a key used to encrypt objects. The header is used in SSE-C mode. The MD5 value is used to check whether any error occurs during the transmission of the key. Type: string Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ== Constraint: 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. |
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. |
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 |
Description |
---|---|
x-obs-server-side-encryption |
This header is included in a response if SSE-KMS is used. Type: string Example: x-obs-server-side-encryption:kms |
x-obs-server-side-encryption-kms-key-id |
Indicates the master key ID. This header is included in a response if SSE-KMS is used. Type: string Format: regionID:domainID:key/key_id regionID indicates the ID of the region where the key belongs. domainID indicates the ID of the tenant where the key belongs. key_id indicates the key ID used in this encryption. Example: x-obs-server-side-encryption-kms-key-id:region:domainiddomainiddomainiddoma0001:key/4f1cd4de-ab64-4807-920a-47fc42e7f0d0 |
x-obs-server-side-encryption-customer-algorithm |
Indicates an encryption algorithm. This header is included in a response if SSE-C is used. Type: string Example: x-obs-server-side-encryption-customer-algorithm:AES256 |
x-obs-server-side-encryption-customer-key-MD5 |
Indicates the MD5 value of a key used to encrypt objects. This header is included in a response if SSE-C is used. Type: string Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ== |
This response involves 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 |