CompleteMultipartUpload
Updated at:2025-11-03
API description
After the requester uploads all parts using the UploadPart operation, the CompleteMultipartUpload command is used to complete the entire MultipartUpload process. This command requires the requester to provide a valid parts list, including the PartNumber and eTag of each part. Upon receiving this command, BOS will validate the data and then combine all parts into a single object.
Request
-
Request syntax
Plain Text1POST /<ObjectName>?uploadId=UploadId HTTP/1.1 2Host: <BucketName>.bj.bcebos.com 3Date: <Date> 4Authorization: <AuthorizationString> 5Content-Length: <ContentLength> 6Content-Type: text/plain -
Request headers
| Name | Types | Description | Whether required |
|---|---|---|---|
| Content-Length | Long Int | Header, length of JSON data | Yes |
| x-bce-meta-* | String | User-defined meta | No |
| Name | Types | Description | Whether required |
|---|---|---|---|
| parts | - | The root node of the JSON body | Yes |
| + partNumber | Int | Serial number of this part in the target object. The partNum has a value range of 1-10000. PartNumbers in a MultiPart must be strictly ordered. If there are 3 parts, PartNumbers could be 1, 3, 5. |
Yes |
| + eTag | String | The HTTP protocol entity tag of object | Yes |
Response
| Name | Types | Description |
|---|---|---|
| bucket | String | Bucket to which this object belongs |
| eTag | String | The HTTP protocol entity tag of object |
| key | String | Object name |
| location | String | URL of this object |
Plain Text
1> **Note**
2>
3> 1. The request body for CompleteMultipartUpload must not exceed 1 MB in size.
4> 2. PartNumbers in a MultipartUpload can be non-sequential, e.g., 1, 3, 5.
Example
-
Request example
Plain Text1POST /ObjectName?uploadId=UploadId HTTP/1.1 2Host: BucketName.bj.bcebos.com 3Date: Wed, 06 Apr 2016 06:34:40 GMT 4Authorization: AuthorizationString 5Content-Length: 11434 6Content-Type: text/plain 7{ 8 "parts":[ 9 { 10 "partNumber":1, 11 "eTag":"a54357aff0632cce46d942af68356b38" 12 }, 13 { 14 "partNumber":2, 15 "eTag":"0c78aef83f66abc1fa1e8477f296d394" 16 }, 17 { 18 "partNumber":3, 19 "eTag":"acbd18db4cc2f85cedef654fccc4a4d8" 20 } 21 ] 22} -
Response example
Plain Text1HTTP/1.1 200 OK 2x-bce-request-id: 4db2b34d-654d-4d8a-b49b-3049ca786409 3Date: Wed, 06 Apr 2016 06:34:40 GMT 4Connection: close 5Server: BceBos 6{ 7 "location":"http://bj.bcebos.com/BucketName/ObjectName", 8 "bucket":"BucketName", 9 "key":"object", 10 "eTag":"3858f62230ac3c915f300c664312c11f" 11}
