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
Name | Description | Required | Type |
---|---|---|---|
uploadId | Upload ID identifying the multipart upload to complete | Yes | text |
Headers
Name | Description | Required | Type |
---|---|---|---|
If-Match | Return the object only if its entity tag (ETag) is the same as the one specified, otherwise return a 412 (precondition failed) error | No | text |
If-None-Match | Return the object only if its entity tag (ETag) is different from the one specified, otherwise return a 304 (not modified) error | No | text |
x-amz-checksum-crc32 | This 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 object | No | text |
x-amz-checksum-crc32c | This 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 object | No | text |
x-amz-checksum-crc64nvme | This 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 checksum | No | text |
x-amz-checksum-sha1 | This 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 object | No | text |
x-amz-checksum-sha256 | This 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 object | No | text |
x-amz-checksum-type | This 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 | No | text |
x-amz-expected-bucket-owner | The 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) | No | text |
x-amz-mp-object-size | The 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 error | No | text |
x-amz-request-payer | Confirms 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 | No | text |
x-amz-server-side-encryption-customer-algorithm | The 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. | No | text |
x-amz-server-side-encryption-customer-key | The server-side encryption (SSE) customer managed key. This parameter is needed only when the object was created using a checksum algorithm. | No | text |
x-amz-server-side-encryption-customer-key-MD5 | The MD5 server-side encryption (SSE) customer managed key. This parameter is needed only when the object was created using a checksum algorithm. | No | text |
Request Body
Name | Description | Required | Type |
---|---|---|---|
CompleteMultipartUpload | Root level tag for the CompleteMultipartUpload parameters | Yes | String |
Part | Array of CompletedPart data types. If you do not supply a valid Part with your request, the service sends back an HTTP 400 response. | No | String |
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
Name | Description | Required | Type |
---|---|---|---|
x-amz-id-2 | An identifier for the request | No | String |
x-amz-request-id | A unique identifier for the request | No | String |
Date | The date and time at which the response was sent | No | String |
x-amz-server-side-encryption | If 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 | No | String |
x-amz-server-side-encryption-aws-kms-key-id | If 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 object | No | String |
x-amz-server-side-encryption-context | If 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 pairs | No | String |
x-amz-version-id | Version ID of the newly created object, in case the bucket has versioning turned on | No | String |
x-amz-expiration | If 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. | No | String |
x-amz-request-charged | If present, indicates that the requester was successfully charged for the request. Valid values: requester | No | String |
Response Data Elements
This will be returned in XML format.
Name | Description | Required | Type |
---|---|---|---|
CompleteMultipartUploadResult | Container for the response | No | container |
Location | The URI that identifies the newly created object | No | string |
Bucket | Name of the bucket that contains the newly created object | No | string |
Key | The object key of the newly created object Constraints: Minimum length of 1 | No | string |
ETag | Entity 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 digits | No | string |
ChecksumCRC32 | The 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 part | No | string |
ChecksumCRC32C | The 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 part | No | string |
ChecksumCRC64NVME | The base64-encoded, 64-bit CRC64NVME checksum of the object. The CRC64NVME checksum is always a full object checksum | No | string |
ChecksumSHA1 | The 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 part | No | string |
ChecksumSHA256 | The 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 part | No | string |
ChecksumType | The 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 | No | string |
Special Errors
Error Code | Description | Status Code |
---|---|---|
NoSuchUpload | The specified multipart upload does not exist | 404 Not Found |
EntityTooSmall | Your 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 |
InvalidPart | One or more of the specified parts could not be found | 400 bad Request |
InvalidPartOrder | The parts list is not in ascending order by part number | 400 Bad Request |
InvalidRequest | The XML in the request body was not well-formed or did not validate against our published schema | 400 Bad Request |
MalformedXML | The XML provided was not well-formed or did not validate against our published schema | 400 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.