Baidu AI Cloud
中国站

百度智能云

Object Storage

CompleteMultipartUpload

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 syntax

    POST /<ObjectName>?uploadId=UploadId HTTP/1.1
    Host: <BucketName>.bj.bcebos.com
    Date: <Date>
    Authorization: <AuthorizationString>
    Content-Length: <ContentLength>
    Content-Type: text/plain	
  • Query parameters

    Name 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 field

    Name 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 field

    No special header field.

  • Response element

    Name 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

    1. The request body for CompleteMultipartUpload is up to 1 MB.
    2. The PartNumber of a MultiPart can be discontinuous, e.g., 1, 3, and 5.

Example

  • Request example

    POST /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 example

    HTTP/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"
    }
Previous
AbortMultipartUpload
Next
InitiateMultipartUpload