For the object larger than 5 GB, you can use the multipart upload to split it into multiple data blocks (called parts in OSS) and upload them separately. When you have uploaded all parts, OSS constructs the object from the uploaded parts.
We recommend that you use the multipart upload in the following scenarios:
- Poor network connectivity: If the upload of one part fails, you can re-upload only the failed part instead of all parts.
- Resumable upload required: An upload in progress can be paused and resumed at any time.
- Upload acceleration: Multiple parts can be uploaded concurrently to speed up the process.
- Streaming upload: Objects of unknown sizes can be uploaded at any time. This scenario is common in industry applications such as video surveillance.
The workflow of the multipart upload is shown as follows:
The description of the workflow is as follows:
- You split the object into multiple parts.
- You initiate a multipart upload task. For more information, see (InitiateMultipartUpload).
- You upload the parts one by one or concurrently. For more information, see (UploadPart).
- After all the parts are uploaded, OSS combines them into the original object. For more information, see (CompleteMultipartUpload).
When you use the multipart upload, take the following into consideration:
- All the parts, except the last one, must not be smaller than 100 KB. Otherwise, the call to the CompleteMultipartUpload interface fails.
- After the object is split into parts, the parts are ordered by the partNumbers specified during the upload. The upload speed does not correlate to the number of parts uploaded concurrently, because both the network conditions and the device load must be considered.
- By default, when the upload is complete but the call to the CompleteMultipartUpload interface fails, the uploaded parts will not be deleted automatically. You can call the AbortMultipartUpload interface to terminate the upload and save the storage space. To automatically delete the uploaded parts, see Manage object lifecycle.
The uploaded parts will not disappear unless you delete them. Therefore, the multipart upload can be considered as the resumable upload.
If the system crashes during a multipart upload, you can resume the upload by using the ListMultipartUploads and the ListPartsinterface to list the uploaded parts in each task. This allows uploads to be resumed from the last uploaded part. The same logic applies to pausing and resuming uploads.
The multipart upload is particularly well suited for the data transfer between mobile devices and the large file upload.
- The maximum size of an object is determined by the size of parts. The multipart upload supports a maximum of 10,000 parts, and each part must be at least 100 KB (except for the last part, which may be smaller) and no more than 5 GB. Therefore, the object size must not exceed 48.8 TB.
- The naming conventions of objects are as follows:
- Object names must use UTF-8 encoding.
- Object names must be at least 1 byte and no more than 1,023 bytes in length.
- Object names cannot start with a backslash ( \ ) or a forward slash ( / ).
Security and authorization
To prevent unauthorized third parties from uploading objects to your bucket, OSS provides access control both on the bucket level and on the object level. For more information, see Access control.
OSS also provides account-level authorization for third-party uploads. For more information, see Authorized third-party uploads.