El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Completing a Multipart Upload

Updated on 2024-03-05 GMT+08:00

Functions

After uploading all parts for a multipart upload, you can use this operation to complete the multipart upload. Before performing this operation, you cannot download the uploaded data. When merging parts, you need to copy the additional message header information recorded during the initialization of the multipart upload task to the object metadata. The processing process is the same as that of the common upload object with these message headers. In the case of merging parts concurrently, the Last Write Win policy must be followed but the time for initiating Last Write is specified as the time when a part multipart upload is initiated.

If a multipart upload has not been aborted, the uploaded parts occupy your storage quota. After all parts in the multipart upload are merged to an object, only the object occupies your storage quota. If a part uploaded in a multipart upload is not used in any merging parts multipart uploads, the part will be deleted to release storage quota.

You can send a request for downloading all or some data of the generated multipart by specifying a range.

You can send a request for deleting all parts uploaded in a multipart upload. Deleted data cannot be restored.

The merged parts do not use the MD5 value of entire object as the ETag. Their ETag is calculated as follows: MD5(M1M2...MN)-N, where Mn is the MD5 value of part n (N is the total number of parts). As described in the Sample Request, there are three parts and each part has an MD5 value. The MD5 values of the three parts are recalculated to obtain a new MD5 value. Then -N is added to the right of the MD5 value to get the ETag of the combined parts. In this example, -N is -3.

If the response to an object merge request times out and error 500 or 503 is returned, you can first obtain the object metadata of the multipart upload task. Then, check whether the value of header x-obs-uploadId in the response is the same as the ID of this multipart upload task. If they are the same, object parts have been successfully merged on the server and you do not need to try again. For details, see Consistency of Concurrent Operations.

Versioning

If a bucket has versioning enabled, a unique version ID is generated for an object created from a multipart upload in this bucket and the version ID is returned in response header x-obs-version-id. If versioning is suspended for a bucket, the object version obtained after the merge is null. For details about the versioning statuses of a bucket, see Configuring Versioning for a Bucket.

NOTICE:

If 10 parts are uploaded but only nine parts are selected for merge, the parts that are not merged will be automatically deleted by the system. The parts that are not merged cannot be restored after being deleted. Before combining the parts, adopt the interface used to list the parts that have been uploaded to check all parts to ensure that no part is missed.

Request Syntax

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
POST /ObjectName?uploadId=uploadID HTTP/1.1 
Host: bucketname.obs.region.example.com
Date: date
Content-Length: length
Authorization: authorization
<CompleteMultipartUpload> 
    <Part> 
        <PartNumber>partNum</PartNumber> 
        <ETag>etag</ETag> 
    </Part> 
    <Part> 
        <PartNumber>partNum</PartNumber> 
        <ETag>etag</ETag> 
    </Part> 
    <Part> 
        <PartNumber>partNum</PartNumber> 
        <ETag>etag</ETag> 
    </Part> 
</CompleteMultipartUpload>

Request Parameters

This request uses parameters to specify the ID of a multipart upload whose parts will be merged. Table 1 describes the parameters.

Table 1 Request parameters

Parameter

Description

Mandatory

uploadId

Indicates a multipart upload.

Type: string

Yes

Request Headers

This request uses common headers. For details, see Table 3.

Request Elements

This request uses elements to specify the list of parts to be merged. Table 2 describes the elements.

Table 2 Request Elements

Element

Description

Mandatory

CompleteMultipartUpload

List of parts to be combined

Type: XML

Yes

PartNumber

Part number

Type: integer

Yes

ETag

ETag value returned upon successful upload of a part. It is the unique identifier of the part content. This parameter is used to verify data consistency when parts are merged.

Type: string

Yes

Response Syntax

1
2
3
4
5
6
7
8
9
HTTP/1.1 status_code
Date: date
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
<CompleteMultipartUploadResult xmlns="http://obs.region.example.com/doc/2015-06-30/">
    <Location>http://example-Bucket.obs.region.example.com/example-Object</Location> 
    <Bucket>bucketname</Bucket> 
    <Key>ObjectName</Key> 
    <ETag>ETag</ETag> 
</CompleteMultipartUploadResult>

Response Headers

The response to the request uses common headers. For details, see Table 1.

In addition to the common response headers, the message headers listed in Table 3 may be used.

Table 3 Additional response headers

Header

Description

x-obs-version-id

Version of the object after parts being merged.

Type: string

x-obs-server-side-encryption

This header is included in a response if SSE-KMS is used.

Type: string

Example: x-obs-server-side-encryption:kms

x-obs-server-side-encryption-kms-key-id

Indicates the master key ID. This header is included in a response if SSE-KMS is used.

Type: string

Format: regionID:domainID:key/key_id

regionID indicates the ID of the region where the key belongs. domainID indicates the ID of the tenant where the key belongs. key_id indicates the key ID used in this encryption.

Example: x-obs-server-side-encryption-kms-key-id:region:domainiddomainiddomainiddoma0001:key/4f1cd4de-ab64-4807-920a-47fc42e7f0d0

x-obs-server-side-encryption-customer-algorithm

Indicates an encryption algorithm. This header is included in a response if SSE-C is used.

Type: string

Example: x-obs-server-side-encryption-customer-algorithm:AES256

Response Elements

This response uses elements to return the result of merging parts. Table 4 describes the elements.

Table 4 Response elements

Element

Description

Location

Path of the object after parts have been merged.

Type: string

Bucket

Bucket in which parts are merged.

Type: string

Key

Indicates the key of the generated object.

Type: string

ETag

The result calculated based on the ETag of each part is the unique identifier of the object content.

Type: string

Error Responses

  1. If no message body exists, OBS returns 400 Bad Request.
  2. If the message body format is incorrect, OBS returns 400 Bad Request.
  3. If the part information in the message body is not sorted by part sequence number, OBS returns 400 Bad Request and the error code is InvalidPartOrder.
  4. If the AK or signature is invalid, OBS returns 403 Forbidden and the error code is AccessDenied.
  5. If the requested bucket is not found, OBS returns 404 Not Found and the error code is NoSuchBucket.
  6. If the requested multipart upload does not exist, OBS returns 404 Not Found and error code NoSuchUpload.
  7. If the user is not the initiator of the task, OBS returns 403 Forbidden and the error code is AccessDenied.
  8. If the request part list contains a part that does not exist, OBS returns 400 Bad Request and the error code is InvalidPart.
  9. If the part's ETag contained in the request list is incorrect, OBS returns 400 Bad Request with an error code of InvalidPart.
  10. If the size of a part other than the last part is smaller than 100 KB, OBS returns 400 Bad Request.
  11. If the size of the object is greater than 48.8 TB after parts being merged, OBS returns status code 400 Bad Request.

Other errors are included in Table 2.

Sample Request

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
POST /object02?uploadId=00000163D46218698DF407362295674C HTTP/1.1
User-Agent: curl/7.29.0
Host: examplebucket.obs.region.example.com
Accept: */*
Date: WED, 01 Jul 2015 05:23:46 GMT
Authorization: OBS H4IPJX0TQTHTHEBQQCEC:dOfK9iILcKxo58tRp3fWeDoYzKA=
Content-Length: 422

<?xml version="1.0" encoding="utf-8"?>
<CompleteMultipartUpload> 
  <Part> 
    <PartNumber>1</PartNumber>  
    <ETag>a54357aff0632cce46d942af68356b38</ETag> 
  </Part>  
  <Part> 
    <PartNumber>2</PartNumber>  
    <ETag>0c78aef83f66abc1fa1e8477f296d394</ETag> 
  </Part>  
  <Part> 
    <PartNumber>3</PartNumber>  
    <ETag>acbd18db4cc2f85cedef654fccc4a4d8</ETag> 
  </Part>
</CompleteMultipartUpload>

Sample Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
HTTP/1.1 200 OK
Server: OBS
x-obs-request-id: 8DF400000163D4625BE3075019BD02B8
x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSN8D1AfQcIvyGBZ9+Ee+jU6zv1iYdO4
Content-Type: application/xml
Date: WED, 01 Jul 2015 05:23:46 GMT
Content-Length: 326

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<CompleteMultipartUploadResult xmlns="http://obs.example.com/doc/2015-06-30/">
  <Location>/examplebucket/object02</Location>
  <Bucket>examplebucket</Bucket>
  <Key>object02</Key>
  <ETag>"03f814825e5a691489b947a2e120b2d3-3"</ETag>
</CompleteMultipartUploadResult>

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback