Skip to main content

CompleteMultipartUpload

Completes a multipart upload by assembling previously uploaded parts.

Description

The CompleteMultipartUpload operation completes a multipart upload by assembling previously uploaded parts. You first initiate the multipart upload and then upload all parts using the UploadPart operation. After successfully uploading all relevant parts, you call this operation to complete the upload.

note
  • When you call CompleteMultipartUpload, QStorage constructs the object from the uploaded parts.
  • You must include the parts in the request in the order that they were uploaded.
  • Processing of a Complete Multipart Upload request could take several minutes.
  • After QStorage begins processing the request, it sends an HTTP response header that specifies a 200 OK response.
  • The ETag of the completed object is not an MD5 hash of the entire object. Instead, it is calculated by concatenating the ETags of the individual parts and then computing the MD5 hash of the concatenated string.
  • You can use SSE, but this means your uploaded data will be encrypted twice, once with the specified key, and again for storage.

Request Syntax

POST /ObjectKey?uploadId=UploadId HTTP/1.1
Host: BucketName.qstorage.quilibrium.com
x-amz-expected-bucket-owner: OwnerAccountId
x-amz-server-side-encryption: EncryptionAlgorithm
x-amz-server-side-encryption-aws-kms-key-id: KMSKeyId
x-amz-server-side-encryption-context: EncryptionContext
<?xml version="1.0" encoding="UTF-8"?> <CompleteMultipartUpload> <Part> <PartNumber>PartNumber</PartNumber> <ETag>ETag</ETag> <ChecksumCRC32>CRC32</ChecksumCRC32> <ChecksumCRC32C>CRC32C</ChecksumCRC32C> <ChecksumCRC64NVME>CRC64NVME</ChecksumCRC64NVME> <ChecksumSHA1>SHA1</ChecksumSHA1> <ChecksumSHA256>SHA256</ChecksumSHA256> </Part> ... </CompleteMultipartUpload>
Values in italics indicate user input and should be replaced with actual values.

Request Parameters

URI Parameters

NameDescriptionRequiredType
uploadIdUpload ID identifying the multipart upload to completeYestext

Headers

NameDescriptionRequiredType
If-MatchReturn the object only if its entity tag (ETag) is the same as the one specified, otherwise return a 412 (precondition failed) errorNotext
If-None-MatchReturn the object only if its entity tag (ETag) is different from the one specified, otherwise return a 304 (not modified) errorNotext
x-amz-checksum-crc32This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 32-bit CRC32 checksum of the objectNotext
x-amz-checksum-crc32cThis header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 32-bit CRC32C checksum of the objectNotext
x-amz-checksum-crc64nvmeThis header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 64-bit CRC64NVME checksum of the object. The CRC64NVME checksum is always a full object checksumNotext
x-amz-checksum-sha1This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 160-bit SHA1 digest of the objectNotext
x-amz-checksum-sha256This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 256-bit SHA256 digest of the objectNotext
x-amz-checksum-typeThis header specifies the checksum type of the object, which determines how part-level checksums are combined to create an object-level checksum for multipart objects. If the checksum type doesn't match the checksum type that was specified for the object during the CreateMultipartUpload request, it'll result in a BadDigest error

Valid values: COMPOSITE | FULL_OBJECT
Notext
x-amz-expected-bucket-ownerThe account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied)Notext
x-amz-mp-object-sizeThe expected total object size of the multipart upload request. If there's a mismatch between the specified object size value and the actual object size value, it results in an HTTP 400 InvalidRequest errorNotext
x-amz-request-payerConfirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests

Valid values: requester
Notext
x-amz-server-side-encryption-customer-algorithmThe server-side encryption (SSE) algorithm used to encrypt the object. This parameter is required only when the object was created using a checksum algorithm or if your bucket policy requires the use of SSE-C.Notext
x-amz-server-side-encryption-customer-keyThe server-side encryption (SSE) customer managed key. This parameter is needed only when the object was created using a checksum algorithm.Notext
x-amz-server-side-encryption-customer-key-MD5The MD5 server-side encryption (SSE) customer managed key. This parameter is needed only when the object was created using a checksum algorithm.Notext

Request Body

NameDescriptionRequiredType
CompleteMultipartUploadRoot level tag for the CompleteMultipartUpload parametersYesString
PartArray of CompletedPart data types.

If you do not supply a valid Part with your request, the service sends back an HTTP 400 response.
NoString

Examples

Example 1: Complete a multipart upload

POST /large-file.zip?uploadId=VXBsb2FkIElEIGZvciA2aWWpbmcncyBteS1tb3ZpZS5tMnRzIHVwbG9hZA HTTP/1.1
Host: my-bucket.qstorage.quilibrium.com
<?xml version="1.0" encoding="UTF-8"?> <CompleteMultipartUpload> <Part> <PartNumber>1</PartNumber> <ETag>"7778aef83f66abc1fa1e8477f296d394"</ETag> </Part> <Part> <PartNumber>2</PartNumber> <ETag>"7778aef83f66abc1fa1e8477f296d394"</ETag> </Part> </CompleteMultipartUpload>
Values in italics indicate user input and should be replaced with actual values.
HTTP/1.1 200 OK
x-amz-id-2: Example7qoYGN7uMuFuYS6m7a4l
x-amz-request-id: TX234S0F24A06C7
Date: Wed, 01 Mar 2024 12:00:00 GMT
<?xml version="1.0" encoding="UTF-8"?> <CompleteMultipartUploadResult> <Location>https://my-bucket.qstorage.quilibrium.com/large-file.zip</Location> <Bucket>my-bucket</Bucket> <Key>large-file.zip</Key> <ETag>"7778aef83f66abc1fa1e8477f296d394-2"</ETag> </CompleteMultipartUploadResult>
Values in italics indicate variable response values.

Response Syntax

HTTP/1.1 200 OK
x-amz-id-2: RequestId
x-amz-request-id: AmazonRequestId
Date: ISO8601Date
x-amz-server-side-encryption: EncryptionAlgorithm
x-amz-server-side-encryption-aws-kms-key-id: KMSKeyId
x-amz-server-side-encryption-context: EncryptionContext
<?xml version="1.0" encoding="UTF-8"?> <CompleteMultipartUploadResult> <Location>URL</Location> <Bucket>BucketName</Bucket> <Key>ObjectKey</Key> <ETag>EntityTag</ETag> <ChecksumCRC32>CRC32</ChecksumCRC32> <ChecksumCRC32C>CRC32C</ChecksumCRC32C> <ChecksumCRC64NVME>CRC64NVME</ChecksumCRC64NVME> <ChecksumSHA1>SHA1</ChecksumSHA1> <ChecksumSHA256>SHA256</ChecksumSHA256> </CompleteMultipartUploadResult>
Values in italics indicate variable response values.

Response Elements

Response Headers

NameDescriptionRequiredType
x-amz-id-2An identifier for the requestNoString
x-amz-request-idA unique identifier for the requestNoString
DateThe date and time at which the response was sentNoString
x-amz-server-side-encryptionIf the object is stored using server-side encryption with an QKMS key, the response includes this header with the value of the server-side encryption algorithm used when storing this object in QStorage

Valid values: AES256 | verenc
NoString
x-amz-server-side-encryption-aws-kms-key-idIf x-amz-server-side-encryption is present and has the value of verenc, this header specifies the ID of the AWS Key Management Service (QKMS) symmetric encryption customer managed key that was used for the objectNoString
x-amz-server-side-encryption-contextIf present, specifies the QKMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairsNoString
x-amz-version-idVersion ID of the newly created object, in case the bucket has versioning turned onNoString
x-amz-expirationIf the object expiration is configured, this will contain the expiration date (expiry-date) and rule ID (rule-id). The value of rule-id is URL-encoded.NoString
x-amz-request-chargedIf present, indicates that the requester was successfully charged for the request.

Valid values: requester
NoString

Response Data Elements

This will be returned in XML format.

NameDescriptionRequiredType
CompleteMultipartUploadResultContainer for the responseNocontainer
LocationThe URI that identifies the newly created objectNostring
BucketName of the bucket that contains the newly created objectNostring
KeyThe object key of the newly created object

Constraints: Minimum length of 1
Nostring
ETagEntity tag that identifies the newly created object's data. Objects with different object data will have different entity tags. The entity tag is an opaque string. The entity tag may or may not be an MD5 digest of the object data. If the entity tag is not an MD5 digest of the object data, it will contain one or more nonhexadecimal characters and/or will consist of less than 32 or more than 32 hexadecimal digitsNostring
ChecksumCRC32The base64-encoded, 32-bit CRC32 checksum of the object. This checksum is only present if the checksum was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual partNostring
ChecksumCRC32CThe base64-encoded, 32-bit CRC32C checksum of the object. This checksum is only present if the checksum was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual partNostring
ChecksumCRC64NVMEThe base64-encoded, 64-bit CRC64NVME checksum of the object. The CRC64NVME checksum is always a full object checksumNostring
ChecksumSHA1The base64-encoded, 160-bit SHA1 digest of the object. This will only be present if the object was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual partNostring
ChecksumSHA256The base64-encoded, 256-bit SHA256 digest of the object. This will only be present if the object was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual partNostring
ChecksumTypeThe checksum type, which determines how part-level checksums are combined to create an object-level checksum for multipart objects. You can use this header as a data integrity check to verify that the checksum type is the same as what was specified during the CreateMultipartUpload request.

Valid values: COMPOSITE | FULL_OBJECT
Nostring

Special Errors

Error CodeDescriptionStatus Code
NoSuchUploadThe specified multipart upload does not exist404 Not Found
EntityTooSmallYour proposed upload is smaller than the minimum allowed object size. Each part must be at least 5 MB in size, except the last part.400 Bad Request
InvalidPartOne or more of the specified parts could not be found400 bad Request
InvalidPartOrderThe parts list is not in ascending order by part number400 Bad Request
InvalidRequestThe XML in the request body was not well-formed or did not validate against our published schema400 Bad Request
MalformedXMLThe XML provided was not well-formed or did not validate against our published schema400 Bad Request

Permissions

You must have the s3:PutObject permission.

Try It Out

Test CompleteMultipartUpload

Complete a multipart upload by assembling previously uploaded parts.

Coming Soon

This feature is currently under development and will be available soon.