Upload Part

After initiating a multipart upload, you can use this operation to upload parts for the multipart upload using its uploadId.

In a multipart upload for a specific object, parts of the object can be uploaded in any sequence and multiple parts can be uploaded concurrently.

Part sizes range from 5 MB to 5 GB. However, in a complete multipart operation, the size of the last uploaded part ranges from 0 to 5 GB. In addition, the uploadId of each part must be in the range of 1 to 10000.

This operation supports server-side encryption.

NOTICE:

When the same multipart of the same object is uploaded concurrently, the server complies with the Last Write Win policy.

The time of Last Write is the creation time of the multipart metadata. To ensure data security, you must add a lock to the client to ensure the upload consistency of the same multipart. There is no need to add a lock when different parts of the same object are uploaded.

Request Syntax

PUT /ObjectName?partNumber=partNum&uploadId=uploadID  HTTP/1.1 
Host: bucketname.obs.cn-north-1.myhwclouds.com
Date: date
Content-Length: length
Authorization: authorization
Content-MD5: md5
<object Content>

Request Parameters

This request uses parameters to specify the ID of a multipart upload and part number. Table 1 describes the parameters.

Table 1 Request parameters

Parameter

Description

Required or Optional

partNumber

Indicates the number that identifies a part to be uploaded. It can be any number from 1 to 10,000.

Type: integer

Required

uploadId

Indicates the ID of a multipart upload.

Type: string

Required

Request Headers

This request uses common headers. For details about common request headers, see Common Request Headers.

Table 2 Request headers

Header

Description

Required or Optional

x-amz-server-side-encryption-customer-algorithm

Indicates an encryption algorithm. The header is used in SSE-C mode.

Type: string

Example: x-amz-server-side-encryption-customer-algorithm:AES256

Constraints: This header must be used together with x-amz-server-side-encryption-customer-key and x-amz-server-side-encryption-customer-key-MD5.

Optional. This header is required if SSE-C mode is used. The algorithm must be the same as that for Initiate Multipart Upload.

x-amz-server-side-encryption-customer-key

Indicates a key used to encrypt objects. The header is used in SSE-C mode.

Type: string

Example: x-amz-server-side-encryption-customer-key:K7QkYpBkM5+hcs27fsNkUnNVaobncnLht/rCB2o/9Cw=

Constraints: This header is a base64-encoded 256-bit key and must be used together with x-amz-server-side-encryption-customer-algorithm and x-amz-server-side-encryption-customer-key-MD5.

Optional. This header is required if SSE-C mode is used. The key must be the same as that for Initiate Multipart Upload.

x-amz-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-amz-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

Constraints: This header is a base64-encoded 128-bit MD5 value and must be used together with x-amz-server-side-encryption-customer-algorithm and x-amz-server-side-encryption-customer-key.

Optional. This header is required if SSE-C mode is used. The MD5 value must be the same as that for Initiate Multipart Upload.

Request Elements

This request involves no elements.

Response Syntax

HTTP/1.1 status_code
Date: date
ETag: etag
Content-Length: length

Response Headers

This response uses common headers. For details about common response headers, see Common Response Headers.

Table 3 Response headers

Header

Description

x-amz-server-side-encryption

This header is included in a response if SSE-KMS is used.

Type: string

Example: x-amz-server-side-encryption:aws:kms

x-amz-server-side-encryption-aws-kms-key-id

Indicates the master key ID. This header is included in a response if SSE-KMS is used.

Example: x-amz-server-side-encryption-aws-kms-key-id:arn:aws:kms:sichuan:domainiddomainiddomainiddoma0001:key/4f1cd4de-ab64-4807-920a-47fc42e7f0d0

x-amz-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-amz-server-side-encryption-customer-algorithm:AES256

x-amz-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-amz-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

Response Elements

This response involves no elements.

Error Responses

  • If the part number exceeds the range of 1 to 10,000, OBS returns status code 400 Bad Request.
  • If the part size is greater than 5 GB, OBS returns status code 400 Bad Request.
  • If an AK or signature is invalid, OBS returns status code 403 Forbidden and error code AccessDenied.
  • If the requested bucket does not exist, OBS returns status code 404 Not Found and error code NoSuchBucket.
  • View the bucket ACL to check whether the user has the read permission on the requested bucket. If the user does not have the read permission, OBS returns "403: AccessDenied".
  • If the requested multipart upload does not exist, OBS returns status code 404 Not Found and error code NoSuchUpload.
  • If the requester is not the initiator of the multipart upload, OBS returns status code 403 Forbidden and error code AccessDenied.

For details about other error responses, see Table 1.

Registration