CompleteMultipartUpload
Last Updated:2021-12-08
Interface Description
After the requester uploads all parts using UploadPart, this CompleteMultipartUpload command is required to complete the whole MultipartUpload operation. This command requires that the request should provide a valid list of parts, including the PartNumber and eTag of parts. After BOS receives this command, it checks the data and then combines all parts into an object.
Request
- 
Request syntaxPOST /<ObjectName>?uploadId=UploadId HTTP/1.1 Host: <BucketName>.bj.bcebos.com Date: <Date> Authorization: <AuthorizationString> Content-Length: <ContentLength> Content-Type: text/plain
- 
Query parametersName Type Parameter Position Description Required? partNumber Int Request Body Parameter Serial number of this part in the destination object The value range of partNum is 1-10000. The PartNumber of a MultiPart must be strictly ordered. For example, there are three parts, and the PartNumber can be 1, 3, and 5.Yes eTag String Request Body Parameter HTTP protocol entity tag of the object Yes 
- 
Request header fieldName Type Description Required? Content-Length Long Int Header field, length of JSON data Yes x-bce-meta-* String User-defined meta No 
Response
- 
Response header fieldNo special header field. 
- 
Response elementName Type Description bucket String Bucketof this object eTag String HTTP protocol entity tag of the object key String Object Name location String URL of this object Notices - The request body for CompleteMultipartUpload is up to 1 MB.
- The PartNumber of a MultiPart can be discontinuous, e.g., 1, 3, and 5.
 
Example
- 
Request examplePOST /ObjectName?uploadId=UploadId HTTP/1.1 Host: BucketName.bj.bcebos.com Date: Wed, 06 Apr 2016 06:34:40 GMT Authorization: AuthorizationString Content-Length: 11434 Content-Type: text/plain { "parts":[ { "partNumber":1, "eTag":"a54357aff0632cce46d942af68356b38" }, { "partNumber":2, "eTag":"0c78aef83f66abc1fa1e8477f296d394" }, { "partNumber":3, "eTag":"acbd18db4cc2f85cedef654fccc4a4d8" } ] }
- 
Response exampleHTTP/1.1 200 OK x-bce-request-id: 4db2b34d-654d-4d8a-b49b-3049ca786409 Date: Wed, 06 Apr 2016 06:34:40 GMT Connection: close Server: BceBos { "location":"http://bj.bcebos.com/BucketName/ObjectName", "bucket":"BucketName", "key":"object", "eTag":"3858f62230ac3c915f300c664312c11f" }
