Updated on 2025-09-15 GMT+08:00

Multipart Upload

Scenarios

In a multipart upload, an object is split into multiple parts and these parts are uploaded independently. After all parts are uploaded, OBS assembles them into a single object. Generally, if the size of an object reaches 100 MB, you should use multipart upload instead of simple upload. Multipart upload has the following advantages:

  • Improved throughput: Uploading parts in parallel speeds up the upload and maximizes bandwidth utilization.
  • Enhanced robustness against network instability: If a part fails to upload due to network issues, you only need to re-upload that specific part. There is no need to upload the entire object again, which saves both time and traffic.
  • Uploading objects with unknown sizes: You can use multipart upload to upload an object with an unknown size. For example, in video surveillance scenarios, video files are created and uploaded in real time, so multipart upload is a good choice for uploading these files.

Constraints

  • Folders do not support multipart upload.
  • Each request can upload only one part, but multiple requests can be initiated at the same time.
  • Constraints on parts:
    Table 1 Constraints on parts

    Item

    Constraints

    Maximum object size

    48.8 TB

    Maximum number of parts for each upload task

    10,000

    Part number

    1 to 10,000 (inclusive)

    Part size

    5 MB to 5 GB. The size of the last part is between 0 bytes to 5 GB.

    Maximum number of parts returned in response to the request for listing uploaded parts

    1,000

    Maximum number of multipart uploads returned in response to the request for listing initiated multipart uploads

    1,000

  • If you use SSE-C in a multipart upload, you must include the key in the requests for initiating the multipart upload, uploading parts, and copying parts. All requests in this multipart upload must use the same key. The key is not required for completing the multipart upload. The complete object is encrypted using SSE-C.
  • If you use SSE-KMS or SSE-OBS in a multipart upload, you only need to configure the encryption method, algorithm, and key in initiating the multipart upload.

Billing

  • If you want to upload a large number of Deep Archive objects, you can upload them in the Standard storage class and then transition them to the Deep Archive storage class through lifecycle rules to lower the costs on PUT requests.
  • After initiating a multipart upload and uploading one or more parts, you must complete or abort the multipart upload. This ensures that OBS frees up the space for storing the uploaded parts and stops billing you for the parts.

Permissions

Before performing a multipart upload, you must obtain the permissions listed in the following table.

Operation

Required Permission

Initiate a multipart upload.

You must be the bucket owner or have the PutObject permission.

Upload parts.

You must have the PutObject permission.

Complete the multipart upload.

You must have the PutObject permission.

Copy parts.

You must have the PutObject and GetObject permissions.

List uploaded parts.

You must be the bucket owner or have the ListMultipartUploadParts permission.

List multipart uploads.

You must be the bucket owner or have the ListBucketMultipartUploads permission.

Abort the multipart upload.

You must be the bucket owner or have the AbortMultipartUpload permission.

Important Notes

  • If the local file changes during the upload, all parts need to be uploaded again.
  • When concurrent upload operations are performed for the same part of an object, the server follows the Last Write Wins policy, where the Last Write is determined by the time the part's metadata was created. To ensure data accuracy, the client must use a locking mechanism to prevent concurrent uploads of the same part of an object. Locking is not required for concurrent uploads of different parts of an object.
  • When uploading a large number of objects, do not name objects with sequential prefixes, such as timestamps or alphabetical order. Objects with sequential prefixes may cause a large number of object indexes to be stored in a specific storage partition. In such case, if there are too many requests for the objects, the requests cannot be handled efficiently.
  • It is advised to enable versioning to prevent objects with the same name from being overwritten. Versioning keeps multiple versions of an object in the same bucket. You can restore any historical version at any time.

Multipart Upload Process

Figure 1 Process of a multipart upload
Table 2 Process of a multipart upload

No.

Operation

Description

1

Split a file into parts.

On your local client, split a large file into multiple parts. Each part must be between 5 MB and 5 GB in size, except for the last part, which can be 0 bytes to 5 GB.

2

Initiate a multipart upload.

Initiate a multipart upload and obtain the upload ID. The ID is required for all subsequent operations in this multipart upload, such as uploading, assembling, and listing parts.

When initiating a multipart upload, you need to specify the storage class, object ACL, and other object properties. Once specified, you do not need to specify them again when uploading or assembling parts later.

3

Upload parts.

Upload parts. You can upload parts independently and in any order. If your network is in good condition, you can upload parts concurrently to improve the upload speed and make full use of bandwidth. If a part fails to upload, you only need to upload that part again. The upload of other parts remains unaffected.

To abort the upload, make an API call to abort the multipart upload and delete the uploaded parts.

4

Complete the multipart upload.

After all parts are uploaded, assemble the parts into a single, complete object.

Example of a Multipart Upload

OBS Console, OBS Browser+, and obsutil encapsulate the multipart upload procedure. You only need to know how to upload a file using a GUI or CLI. For details, see Ways to Upload. The following uses API Explorer to make OBS API calls to demonstrate how to perform a multipart upload.

Ways to Upload

You can use OBS Console, APIs, SDKs, OBS Browser+, or obsutil to upload objects.

To improve the upload success rate, OBS Console automatically uses multipart upload for objects larger than 8 MB, and OBS Browser+ and obsutil automatically use resumable upload (essentially multipart upload) for objects larger than 50 MB. You will not perceive any backend switchovers, as your operations on OBS Console or tools remain unchanged.

Related Operations

The following are operations related to multipart upload:

References

If you have over 48.8 TB data to upload, refer to Migrating Local Data to OBS.