completeUpload method
The request completes multipart upload.
When receiving the Object Storage request:
- Combines the parts obtained during the upload in the order of their numbering to form a target object.
- Deletes the upload ID, which means that any subsequent requests with that ID will return the
NoSuchUpload
error.
When completing the upload, the client must provide the list of the parts it sent. The description of each part must contain an ETag
the client gets in response to each uploaded part. See uploadPart method.
The operation may take several minutes, depending on the object size and the number of parts.
If the request failed, the client app must be ready to repeat the request.
For more information on getting started with the API and the general request format, see How to use the S3 API.
Request
POST /{bucket}/{key}?uploadId=UploadId HTTP/2
Path parameters
Parameter | Description |
---|---|
bucket |
Bucket name. |
key |
Object key. |
Query parameters
Parameter | Description |
---|---|
uploadId |
ID of the multipart upload returned by Object Storage at startup. |
Headers
Use the appropriate common headers in your request.
Data schema
The list of parts of a multipart upload is passed as an XML file in the following format:
<CompleteMultipartUpload>
<Part>
<PartNumber>PartNumber</PartNumber>
<ETag>ETag</ETag>
</Part>
...
</CompleteMultipartUpload>
Tag | Description |
---|---|
CompleteMultipartUpload |
Request data. Path: /CompleteMultipartUpload . |
Part |
Data on the object uploaded part. Path: /CompleteMultipartUpload/Part . |
PartNumber |
Part number. A unique ID that determines the part position among other parts in the upload. Path: /CompleteMultipartUpload/Part/PartNumber . |
ETag |
ID the client received from Object Storage in response to the upload of a part. Path: /CompleteMultipartUpload/Part/ETag . |
Response
Headers
Responses can only contain common response headers.
Response codes
For a list of possible responses, see Responses.
Additionally, Object Storage may return errors described in the table below.
Error | Description | HTTP code |
---|---|---|
NoSuchUpload |
The specified upload does not exist. The specified upload ID may be incorrect or the upload was completed or deleted. | 404 Not Found |
InvalidPart |
Some of the specified parts were not found. Possible causes: - The parts have not been uploaded. - The provided ETag does not match the saved one. |
400 Bad Request |
InvalidPartOrder |
The list of parts was not provided in the ascending order. The list must be sorted by part number in ascending order. |
400 Bad Request |
A successful response contains additional data in XML format with the schema described below.
Data schema
<CompleteMultipartUploadResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Location>http://Example-Bucket.storage.yandexcloud.net/Example-Object</Location>
<Bucket>Example-Bucket</Bucket>
<Key>Example-Object</Key>
<ETag>"3858f62230ac3c915f300c664312c11f-9"</ETag>
</CompleteMultipartUploadResult>
Tag | Description |
---|---|
CompleteMultipartUploadResult |
Response data. Path: /CompleteMultipartUploadResult . |
Location |
URI of the object created as a result of uploading. Path: /CompleteMultipartUploadResult/Location . |
Bucket |
Name of the bucket where the object resides. Path: /CompleteMultipartUploadResult/Bucket . |
Key |
Key of the created object. Path: /CompleteMultipartUploadResult/Key . |
ETag |
Object hash. ETag may or may not be MD5. Path: /CompleteMultipartUploadResult/ETag . |