Completes the MultipartUpload operation performed on the entire file after all data parts of the file have been uploaded.

During a CompleteMultipartUpload operation, you must provide the list (including the part number and ETags) of all valid data parts. After receiving the part list you have submitted, OSS verifies the validity of each data part individually. After all the data parts have been verified, OSS combines these parts into a complete object.

Request syntax

POST /ObjectName? uploadId=UploadId HTTP/1.1
Date: GMT Date
Content-Length: Size
Authorization: Signature



Request parameters

During the Complete Multipart Upload operation, you can use encoding-type to encode the Key in the returned result.
Name Type Description
encoding-type String Specifies the encoding type of the Key in the returned result. Currently, the URL encoding is supported. The Key adopts UTF-8 encoding, but the XML 1.0 Standard does not support parsing certain control characters, such as the characters with ASCII values from 0 to 10. In case that the Key contains control characters not supported by the XML 1.0 Standard, you can specify the encoding-type to encode the returned Key. 

Default: None

Optional value: url

Request elements

Name Type Description
CompleteMultipartUpload Container Specifies the container used to store the content of the CompleteMultipartUpload request.

Sub-node: One or more part elements 

Parent node: None

ETag String Specifies the ETag value returned by OSS after data parts are successfully uploaded. 

Parent node: Part

Part Container Specifies the container that stores the uploaded data parts. 

Sub-nodes: ETag, PartNumber

Parent node: InitiateMultipartUploadResult

PartNumber Integer Specifies the number of parts.

Parent node: Part

Response elements

Name Type Description
Bucket String Specifies the bucket name.

Parent node: CompleteMultipartUploadResult

CompleteMultipartUploadResult Container Specifies the container that stores the result of the Complete Multipart Upload request. 

Sub-nodes: Bucket, Key, ETag, Location Location

Parent node: None

ETag String Specifies the ETag (entity tag) is created when an object is generated and is used to indicate the content of the object. For the objects created based on the Complete Multipart Upload request, the value of ETag is the UUID of the object content. The value of ETag can be used to check whether the content of the object is changed.

Parent node: CompleteMultipartUploadResult

Location String Specifies the URL of the newly created object.

Parent node: CompleteMultipartUploadResult

Key String Specifies the name of the newly created object. 

Parent node: CompleteMultipartUploadResult

EncodingType String Specifies the encoding type for the returned results. If encoding-type is specified in the request, the Key is encoded in the returned result.

Parent node: Container

Detail analysis

  • When receiving a CompleteMultipartUpload request, OSS verifies that all parts except the last part are larger than 100 KB and checks each part number and ETag in the part list submitted by the user. Therefore, when uploading data parts, the client must record not only the part number but also the ETag value returned by OSS each time a part is uploaded successfully.
  • It takes a few minutes for OSS to process the CompleteMultipartUpload request. During this time, if the client is disconnected from OSS, OSS continues to complete the request.
  • The part numbers in the part list submitted by a user can be non-consecutive. For example, the first part number is 1 and the second part number is 5.
  • After OSS successfully processes the Complete MultipartUpload request, the corresponding Upload ID becomes invalid.
  • The same object may have different Upload IDs. When an Upload ID is completed, other Upload IDs of this object are not affected.
  • If the x-oss-server-side-encryption request header is specified when the Initiate MultipartUpload interface is called, OSS returns the x-oss-server-side-encryption header in the CompleteMultipartUpload response header. The value of x-oss-server-side-encryption indicates the server-side encryption algorithm used for this object.
  • If you have uploaded the Content-MD5 request header, the OSS calculates the body’s Content-MD5 and check if the two are consistent. If the two are different, the error code InvalidDigest is returned.


Request example:

POST / uploadId=0004B9B2D2F7815C432C9057C03134D4 HTTP/1.1
Content-Length: 1056
Date: Fri, 24 Feb 2012 10:19:18 GMT
Authorization: OSS qn6qrrqxo2oawuk53otfjbyc:8VwFhFUWmVecK6jQlHlXMK/zMT0=


Response example:

HTTP/1.1 200 OK
Server: AliyunOSS
Content-Length: 329
Content-Type: Application/xml
Connection: keep-alive
X-OSS-request-ID: 594f0751-3b1e-168f-4501-4ac71d217d6e
Date: Fri, 24 Feb 2012 10:19:18 GMT

<? xml version="1.0" encoding="UTF-8"? >
<CompleteMultipartUploadResult xmlns=””>
    <Location> /</Location>