doc-exports/docs/obs/api-ref/obs_04_0098.html
zhangyue d5b1108742 OBS API DOC
Reviewed-by: Sabelnikov, Dmitriy <dmitriy.sabelnikov@t-systems.com>
Co-authored-by: zhangyue <zhangyue164@huawei.com>
Co-committed-by: zhangyue <zhangyue164@huawei.com>
2023-10-16 12:27:49 +00:00

413 lines
39 KiB
HTML

<a name="obs_04_0098"></a><a name="obs_04_0098"></a>
<h1 class="topictitle1">Initiating a Multipart Upload</h1>
<div id="body13564861"><div class="section" id="obs_04_0098__section5584184924715"><h4 class="sectiontitle">Functions</h4><p class="msonormal" id="obs_04_0098__p65136078">Before using this operation, make an API operation call to create a multipart upload task. The system will return a globally unique upload ID as the multipart upload identifier. This identifier can be used in subsequent requests including UploadPart, CompleteMultipartUpload, and ListParts. Create a multipart upload task does not affect the object that has the same name as object to be uploaded in multiple parts. You can create more than one multipart upload tasks for an object. This operation request can contain headers <strong id="obs_04_0098__b4711005316425">x-obs-acl</strong>, <strong id="obs_04_0098__b2532526016425">x-obs-meta-*</strong>, <strong id="obs_04_0098__b2503398216425">Content-Type</strong>, and <strong id="obs_04_0098__b4850503416425">Content-Encoding</strong>. The headers are recorded in the multipart upload metadata.</p>
<p class="msonormal" id="obs_04_0098__p49353797">This operation supports server-side encryption.</p>
</div>
<div class="section" id="obs_04_0098__section93175917597"><h4 class="sectiontitle">WORM</h4><p id="obs_04_0098__p1566012417013">If a bucket has WORM enabled, you can configure object-level retention policies when initiating multipart uploads. You can specify the <strong id="obs_04_0098__b613882112528">x-obs-object-lock-mode</strong> and <strong id="obs_04_0098__b813852113524">x-obs-object-lock-retain-until-date</strong> headers when you initiate a multipart upload to protect the object assembled. If you do not specify these two headers but have configured a default bucket-level WORM policy, this default policy automatically applies to the object newly assembled. You can also configure or update a WORM retention policy after the object is assembled.</p>
<p id="obs_04_0098__p3483153720114">Different from uploads with PUT and POST, a multipart upload only requires that the date specified in the <strong id="obs_04_0098__b11495105433716">x-obs-object-lock-retain-until-date</strong> header be no later than the initiation time, but does not have to be later than the completion time of the multipart upload. When the default bucket-level WORM policy is applied, the protection starts when the object parts are assembled and ends once the default bucket-level protection period expires. Before assembling the object parts uploaded, the multipart upload can be canceled and will not be affected by the WORM configuration.</p>
</div>
<div class="section" id="obs_04_0098__section41530990"><h4 class="sectiontitle">Request Syntax</h4><div class="codecoloring" codetype="Xml" id="obs_04_0098__screen2968700"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span>POST<span class="w"> </span>/ObjectName?uploads<span class="w"> </span>HTTP/1.1<span class="w"> </span>
Host:<span class="w"> </span>bucketname.obs.region.example.com
Date:<span class="w"> </span>date
Authorization:<span class="w"> </span>authorization
</pre></div></td></tr></table></div>
</div>
</div>
<div class="section" id="obs_04_0098__section38234596"><h4 class="sectiontitle">Request Parameters</h4><p class="msonormal" id="obs_04_0098__p16698915">This request uses parameters to specify a multipart upload. <a href="#obs_04_0098__table13291134">Table 1</a> describes the parameters.</p>
<div class="tablenoborder"><a name="obs_04_0098__table13291134"></a><a name="table13291134"></a><table cellpadding="4" cellspacing="0" summary="" id="obs_04_0098__table13291134" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Request parameters</caption><thead align="left"><tr id="obs_04_0098__row50117065"><th align="left" class="cellrowborder" valign="top" width="24.240000000000002%" id="mcps1.3.4.3.2.4.1.1"><p id="obs_04_0098__p32950449">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="56.57%" id="mcps1.3.4.3.2.4.1.2"><p id="obs_04_0098__p63013022">Description</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.189999999999998%" id="mcps1.3.4.3.2.4.1.3"><p id="obs_04_0098__p34030427">Mandatory</p>
</th>
</tr>
</thead>
<tbody><tr id="obs_04_0098__row45011140"><td class="cellrowborder" valign="top" width="24.240000000000002%" headers="mcps1.3.4.3.2.4.1.1 "><p id="obs_04_0098__p22023722">uploads</p>
</td>
<td class="cellrowborder" valign="top" width="56.57%" headers="mcps1.3.4.3.2.4.1.2 "><p id="obs_04_0098__p39091028">Indicates a multipart upload.</p>
<p id="obs_04_0098__p16274934">Type: string</p>
</td>
<td class="cellrowborder" valign="top" width="19.189999999999998%" headers="mcps1.3.4.3.2.4.1.3 "><p id="obs_04_0098__p43201282">Yes</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="obs_04_0098__section8567047"><h4 class="sectiontitle">Request Headers</h4><p class="msonormal" id="obs_04_0098__p9642950">The request can use additional headers, as shown in <a href="#obs_04_0098__table11912770163049">Table 2</a>.</p>
<div class="tablenoborder"><a name="obs_04_0098__table11912770163049"></a><a name="table11912770163049"></a><table cellpadding="4" cellspacing="0" summary="" id="obs_04_0098__table11912770163049" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request headers</caption><thead align="left"><tr id="obs_04_0098__row31860249"><th align="left" class="cellrowborder" valign="top" width="23.47%" id="mcps1.3.5.3.2.4.1.1"><p id="obs_04_0098__p30543367">Header</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="67.35%" id="mcps1.3.5.3.2.4.1.2"><p id="obs_04_0098__p53080947">Description</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="9.180000000000001%" id="mcps1.3.5.3.2.4.1.3"><p id="obs_04_0098__p41305213">Mandatory</p>
</th>
</tr>
</thead>
<tbody><tr id="obs_04_0098__row14322183543119"><td class="cellrowborder" valign="top" width="23.47%" headers="mcps1.3.5.3.2.4.1.1 "><p id="obs_04_0098__p26969841">x-obs-acl</p>
</td>
<td class="cellrowborder" valign="top" width="67.35%" headers="mcps1.3.5.3.2.4.1.2 "><p id="obs_04_0098__p10531275155">When initiating a multipart upload, you can add this message header to set the permission control policy for the object. The predefined common policies are as follows: <strong id="obs_04_0098__b10316226175712">private</strong>, <strong id="obs_04_0098__b136446312572">public-read</strong>, and <strong id="obs_04_0098__b10892443115710">public-read-write</strong>.</p>
<p id="obs_04_0098__p50162129">Type: string</p>
<p id="obs_04_0098__p48805985">Note: This header is a predefined policy expressed in a character string.</p>
<p id="obs_04_0098__p587119293244">Example: <strong id="obs_04_0098__b723111593712">x-obs-acl: public-read-write</strong></p>
</td>
<td class="cellrowborder" valign="top" width="9.180000000000001%" headers="mcps1.3.5.3.2.4.1.3 "><p id="obs_04_0098__p60970709">No</p>
</td>
</tr>
<tr id="obs_04_0098__row876819301311"><td class="cellrowborder" valign="top" width="23.47%" headers="mcps1.3.5.3.2.4.1.1 "><p id="obs_04_0098__p54102201376">x-obs-grant-read</p>
</td>
<td class="cellrowborder" valign="top" width="67.35%" headers="mcps1.3.5.3.2.4.1.2 "><p id="obs_04_0098__p1041152010375">When initiating a multipart upload, you can use this header to grant all users in an account the permissions to read the object and obtain the object metadata.</p>
<p id="obs_04_0098__p036992924111">Type: string</p>
<p id="obs_04_0098__p253019115249">Example: <strong id="obs_04_0098__b7372195219362">x-obs-grant-read: ID=domainID</strong> If multiple accounts are authorized, separate them with commas (,).</p>
</td>
<td class="cellrowborder" valign="top" width="9.180000000000001%" headers="mcps1.3.5.3.2.4.1.3 "><p id="obs_04_0098__p341182017372">No</p>
</td>
</tr>
<tr id="obs_04_0098__row53481428173115"><td class="cellrowborder" valign="top" width="23.47%" headers="mcps1.3.5.3.2.4.1.1 "><p id="obs_04_0098__p2784192993712">x-obs-grant-read-acp</p>
</td>
<td class="cellrowborder" valign="top" width="67.35%" headers="mcps1.3.5.3.2.4.1.2 "><p id="obs_04_0098__p6913194219811">When initiating a multipart upload, you can use this header to grant all users in an account the permission to obtain the object ACL.</p>
<p id="obs_04_0098__p49151332194119">Type: string</p>
<p id="obs_04_0098__p843643814237">Example: <strong id="obs_04_0098__b165941618103711">x-obs-grant-read-acp: ID=domainID</strong> If multiple accounts are authorized, separate them with commas (,).</p>
</td>
<td class="cellrowborder" valign="top" width="9.180000000000001%" headers="mcps1.3.5.3.2.4.1.3 "><p id="obs_04_0098__p9785429153711">No</p>
</td>
</tr>
<tr id="obs_04_0098__row1812104512308"><td class="cellrowborder" valign="top" width="23.47%" headers="mcps1.3.5.3.2.4.1.1 "><p id="obs_04_0098__p4151526163710">x-obs-grant-write-acp</p>
</td>
<td class="cellrowborder" valign="top" width="67.35%" headers="mcps1.3.5.3.2.4.1.2 "><p id="obs_04_0098__p94031856283">When initiating a multipart upload, you can use this header to grant all users in an account the permission to write the object ACL.</p>
<p id="obs_04_0098__p79212366417">Type: string</p>
<p id="obs_04_0098__p17584184211233">Example: <strong id="obs_04_0098__b541922123710">x-obs-grant-write-acp: ID=domainID</strong> If multiple accounts are authorized, separate them with commas (,).</p>
</td>
<td class="cellrowborder" valign="top" width="9.180000000000001%" headers="mcps1.3.5.3.2.4.1.3 "><p id="obs_04_0098__p1316182618370">No</p>
</td>
</tr>
<tr id="obs_04_0098__row331924114302"><td class="cellrowborder" valign="top" width="23.47%" headers="mcps1.3.5.3.2.4.1.1 "><p id="obs_04_0098__p3389132314376">x-obs-grant-full-control</p>
</td>
<td class="cellrowborder" valign="top" width="67.35%" headers="mcps1.3.5.3.2.4.1.2 "><p id="obs_04_0098__p1914315101898">When initiating a multipart upload, you can use this header to grant all users in an account the permissions to read the object, obtain the object metadata and ACL, and write the object ACL.</p>
<p id="obs_04_0098__p1284513399419">Type: string</p>
<p id="obs_04_0098__p673114440234">Example: <strong id="obs_04_0098__b12460102915377">x-obs-grant-full-control: ID=domainID</strong> If multiple accounts are authorized, separate them with commas (,).</p>
</td>
<td class="cellrowborder" valign="top" width="9.180000000000001%" headers="mcps1.3.5.3.2.4.1.3 "><p id="obs_04_0098__p12389102314371">No</p>
</td>
</tr>
<tr id="obs_04_0098__row46729206"><td class="cellrowborder" valign="top" width="23.47%" headers="mcps1.3.5.3.2.4.1.1 "><p id="obs_04_0098__p26969336">x-obs-storage-class</p>
</td>
<td class="cellrowborder" valign="top" width="67.35%" headers="mcps1.3.5.3.2.4.1.2 "><p id="obs_04_0098__p37032594">When initiating a multipart upload, you can add this header to specify the storage class for the object. If you do not use this header, the object storage class is the default storage class of the bucket.</p>
<p id="obs_04_0098__p64857896">Type: string</p>
<p id="obs_04_0098__p14339210104117">Storage class value options: <strong id="obs_04_0098__b1677713810441">STANDARD</strong> (Standard), <strong id="obs_04_0098__b777763814443">WARM</strong> (Warm), <strong id="obs_04_0098__b1477819384446">COLD</strong> (Cold). These values are case sensitive.</p>
<p id="obs_04_0098__p18998234">Example: <strong id="obs_04_0098__b116516302814">x-obs-storage-class: STANDARD</strong></p>
</td>
<td class="cellrowborder" valign="top" width="9.180000000000001%" headers="mcps1.3.5.3.2.4.1.3 "><p id="obs_04_0098__p62462009">No</p>
</td>
</tr>
<tr id="obs_04_0098__row25287172"><td class="cellrowborder" valign="top" width="23.47%" headers="mcps1.3.5.3.2.4.1.1 "><p id="obs_04_0098__p34995089">x-obs-website-redirect-location</p>
</td>
<td class="cellrowborder" valign="top" width="67.35%" headers="mcps1.3.5.3.2.4.1.2 "><p id="obs_04_0098__p16029950">If a bucket is configured with the static website hosting function, it will redirect requests for this object to another object in the same bucket or to an external URL. OBS stores the value of this header in the object metadata.</p>
<p id="obs_04_0098__p10051824">Type: string</p>
<p id="obs_04_0098__p23357555">Default value: none</p>
<p id="obs_04_0098__p8891409">Constraint: The value must be prefixed by a slash (/), <strong id="obs_04_0098__b14457323930">http://</strong>, or <strong id="obs_04_0098__b1345811231135">https://</strong>. The length of the value cannot exceed 2 KB.</p>
</td>
<td class="cellrowborder" valign="top" width="9.180000000000001%" headers="mcps1.3.5.3.2.4.1.3 "><p id="obs_04_0098__p49115494">No</p>
</td>
</tr>
<tr id="obs_04_0098__row39386263"><td class="cellrowborder" valign="top" width="23.47%" headers="mcps1.3.5.3.2.4.1.1 "><p id="obs_04_0098__p36170774">x-obs-server-side-encryption</p>
</td>
<td class="cellrowborder" valign="top" width="67.35%" headers="mcps1.3.5.3.2.4.1.2 "><p id="obs_04_0098__p44151614">Indicates that SSE-KMS is used. </p>
<p id="obs_04_0098__p61820208">Type: string</p>
<p id="obs_04_0098__p19510966">Example: <strong id="obs_04_0098__b0982113515818">x-obs-server-side-encryption:kms</strong></p>
</td>
<td class="cellrowborder" valign="top" width="9.180000000000001%" headers="mcps1.3.5.3.2.4.1.3 "><p id="obs_04_0098__p36884390">No. This header is required when SSE-KMS is used.</p>
</td>
</tr>
<tr id="obs_04_0098__row63524059"><td class="cellrowborder" valign="top" width="23.47%" headers="mcps1.3.5.3.2.4.1.1 "><p id="obs_04_0098__p45175155">x-obs-server-side-encryption-kms-key-id</p>
</td>
<td class="cellrowborder" valign="top" width="67.35%" headers="mcps1.3.5.3.2.4.1.2 "><p id="obs_04_0098__p35308952">Master key ID. This header is used in SSE-KMS mode. If the customer does not provide the master key ID, the default master key ID will be used. If there is no such a default master key, OBS will create one and use it by default.</p>
<p id="obs_04_0098__p49345114">Type: string</p>
<p id="obs_04_0098__p6679135313114">The following two formats are supported:</p>
<p id="obs_04_0098__p14701134894919">- <em id="obs_04_0098__i64591304515">regionID</em><strong id="obs_04_0098__b1946617308515">:</strong><em id="obs_04_0098__i44668309515">domainID</em><strong id="obs_04_0098__b74661730352">:key/</strong><em id="obs_04_0098__i5466530351">key_id</em></p>
<p id="obs_04_0098__p090816596123">- <em id="obs_04_0098__i207501714175511">key_id</em></p>
<p id="obs_04_0098__p558627121315"><em id="obs_04_0098__i18899203616413">regionID</em> indicates the ID of the region where the key belongs. <em id="obs_04_0098__i149056363419">domainID</em> indicates the ID of the tenant where the key belongs. <em id="obs_04_0098__i1790519366412">key_id</em> indicates the ID of the key created in KMS.</p>
<p id="obs_04_0098__p17830152818144">Examples:</p>
<p id="obs_04_0098__p183251365619">- <strong id="obs_04_0098__b1128351635720">x-obs-server-side-encryption-kms-key-id:</strong><em id="obs_04_0098__i1363614183571">region</em><strong id="obs_04_0098__b1728341620572">:domainiddomainiddomainiddoma0001:key/4f1cd4de-ab64-4807-920a-47fc42e7f0d0</strong></p>
<p id="obs_04_0098__p53311133560">- <strong id="obs_04_0098__b22621128175719">x-obs-server-side-encryption-kms-key-id:4f1cd4de-ab64-4807-920a-47fc42e7f0d0</strong></p>
</td>
<td class="cellrowborder" valign="top" width="9.180000000000001%" headers="mcps1.3.5.3.2.4.1.3 "><p id="obs_04_0098__p2237607">No</p>
</td>
</tr>
<tr id="obs_04_0098__row20138464"><td class="cellrowborder" valign="top" width="23.47%" headers="mcps1.3.5.3.2.4.1.1 "><p id="obs_04_0098__p20602859">x-obs-server-side-encryption-customer-algorithm</p>
</td>
<td class="cellrowborder" valign="top" width="67.35%" headers="mcps1.3.5.3.2.4.1.2 "><p id="obs_04_0098__p58218887">Indicates an encryption algorithm. The header is used in SSE-C mode.</p>
<p id="obs_04_0098__p54207939">Type: string</p>
<p id="obs_04_0098__p18109403">Example: <strong id="obs_04_0098__b2267174216813">x-obs-server-side-encryption-customer-algorithm:AES256</strong></p>
<p id="obs_04_0098__p28766906">Constraint: This header must be used together with <strong id="obs_04_0098__b20101191201216">x-obs-server-side-encryption-customer-key</strong> and <strong id="obs_04_0098__b1910871201217">x-obs-server-side-encryption-customer-key-MD5</strong>.</p>
</td>
<td class="cellrowborder" valign="top" width="9.180000000000001%" headers="mcps1.3.5.3.2.4.1.3 "><p id="obs_04_0098__p48418070">No. This header is required when SSE-C is used.</p>
</td>
</tr>
<tr id="obs_04_0098__row33109454"><td class="cellrowborder" valign="top" width="23.47%" headers="mcps1.3.5.3.2.4.1.1 "><p id="obs_04_0098__p64620092">x-obs-server-side-encryption-customer-key</p>
</td>
<td class="cellrowborder" valign="top" width="67.35%" headers="mcps1.3.5.3.2.4.1.2 "><p id="obs_04_0098__p66844930">The key used to encrypt objects. The header is used in SSE-C mode. This key is used to encrypt objects.</p>
<p id="obs_04_0098__p64733462">Type: string</p>
<p id="obs_04_0098__p45730249">Example: <strong id="obs_04_0098__b13372247988">x-obs-server-side-encryption-customer-key:K7QkYpBkM5+hca27fsNkUnNVaobncnLht/rCB2o/9Cw=</strong></p>
<p id="obs_04_0098__p8919060">Constraint: This header is a Base64-encoded 256-bit key and must be used together with <strong id="obs_04_0098__b123399319412">x-obs-server-side-encryption-customer-algorithm</strong> and <strong id="obs_04_0098__b19339731348">x-obs-server-side-encryption-customer-key-MD5</strong>.</p>
</td>
<td class="cellrowborder" valign="top" width="9.180000000000001%" headers="mcps1.3.5.3.2.4.1.3 "><p id="obs_04_0098__p51355263">No. This header is required when SSE-C is used.</p>
</td>
</tr>
<tr id="obs_04_0098__row59544184"><td class="cellrowborder" valign="top" width="23.47%" headers="mcps1.3.5.3.2.4.1.1 "><p id="obs_04_0098__p58349617">x-obs-server-side-encryption-customer-key-MD5</p>
</td>
<td class="cellrowborder" valign="top" width="67.35%" headers="mcps1.3.5.3.2.4.1.2 "><p id="obs_04_0098__p28698506">Indicates the MD5 value of a key used to encrypt objects. The header is used in SSE-C mode. The MD5 value is used to check whether any error occurs during the transmission of the key. </p>
<p id="obs_04_0098__p56959962">Type: string</p>
<p id="obs_04_0098__p42877611">Example: <strong id="obs_04_0098__b11772201120919">x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==</strong></p>
<p id="obs_04_0098__p50354182">Constraint: This header is a Base64-encoded 128-bit MD5 value and must be used together with <strong id="obs_04_0098__b42631542303">x-obs-server-side-encryption-customer-algorithm</strong> and <strong id="obs_04_0098__b1126916421505">x-obs-server-side-encryption-customer-key</strong>.</p>
</td>
<td class="cellrowborder" valign="top" width="9.180000000000001%" headers="mcps1.3.5.3.2.4.1.3 "><p id="obs_04_0098__p52156967">No. This header is required when SSE-C is used.</p>
</td>
</tr>
<tr id="obs_04_0098__row8838418111"><td class="cellrowborder" valign="top" width="23.47%" headers="mcps1.3.5.3.2.4.1.1 "><p id="obs_04_0098__p1514215711573">x-obs-expires</p>
</td>
<td class="cellrowborder" valign="top" width="67.35%" headers="mcps1.3.5.3.2.4.1.2 "><p id="obs_04_0098__p13631435204018">Specifies when an object expires. It is measured in days. Once the object expires, it is automatically deleted. (The calculation starts from when the object was last modified).</p>
<p id="obs_04_0098__p133831235577">Type: integer</p>
<p id="obs_04_0098__p638302312574">Example: <strong id="obs_04_0098__b1626311717910">x-obs-expires:3</strong></p>
</td>
<td class="cellrowborder" valign="top" width="9.180000000000001%" headers="mcps1.3.5.3.2.4.1.3 "><p id="obs_04_0098__p1014357105719">No</p>
</td>
</tr>
<tr id="obs_04_0098__row419633218242"><td class="cellrowborder" valign="top" width="23.47%" headers="mcps1.3.5.3.2.4.1.1 "><p id="obs_04_0098__p5180191819182"><span style="color:#494949;">x-obs-object-lock-mode</span></p>
</td>
<td class="cellrowborder" valign="top" width="67.35%" headers="mcps1.3.5.3.2.4.1.2 "><p id="obs_04_0098__p6180918151813">WORM mode that will be applied to the object. Currently, only <strong id="obs_04_0098__b65681335105413">COMPLIANCE</strong> is supported. This header must be used together with <strong id="obs_04_0098__b1256918351543">x-obs-object-lock-retain-until-date</strong>.</p>
<p id="obs_04_0098__p14496145181918">Type: string</p>
<p id="obs_04_0098__p154228537191">Example: <strong id="obs_04_0098__b20869162612916">x-obs-object-lock-mode:COMPLIANCE</strong></p>
</td>
<td class="cellrowborder" valign="top" width="9.180000000000001%" headers="mcps1.3.5.3.2.4.1.3 "><p id="obs_04_0098__p2180181810184">No, but required when <strong id="obs_04_0098__b984610174410">x-obs-object-lock-retain-until-date</strong> is present.</p>
</td>
</tr>
<tr id="obs_04_0098__row0590440132419"><td class="cellrowborder" valign="top" width="23.47%" headers="mcps1.3.5.3.2.4.1.1 "><p id="obs_04_0098__p14809920131812"><span style="color:#494949;">x-obs-object-lock-retain-until-date</span></p>
</td>
<td class="cellrowborder" valign="top" width="67.35%" headers="mcps1.3.5.3.2.4.1.2 "><p id="obs_04_0098__p97201718162111">Indicates the expiration time of the Object Lock retention. The value must be a UTC time that complies with ISO 8601, for example, <strong id="obs_04_0098__b489005844910">2015-07-01T04:11:15Z</strong>. This header must be used together with <strong id="obs_04_0098__b68916582492">x-obs-object-lock-mode</strong>.</p>
<p id="obs_04_0098__p1972081822113">Type: string</p>
<p id="obs_04_0098__p372031872119">Example: <strong id="obs_04_0098__b18468113517910">x-obs-object-lock-retain-until-date:2015-07-01T04:11:15Z</strong></p>
</td>
<td class="cellrowborder" valign="top" width="9.180000000000001%" headers="mcps1.3.5.3.2.4.1.3 "><p id="obs_04_0098__p080992031813">No, but required when <strong id="obs_04_0098__b129028313556">x-obs-object-lock-mode</strong> is present.</p>
</td>
</tr>
<tr id="obs_04_0098__row110622973915"><td class="cellrowborder" valign="top" width="23.47%" headers="mcps1.3.5.3.2.4.1.1 "><p id="obs_04_0098__p29252105">x-obs-meta-*</p>
</td>
<td class="cellrowborder" valign="top" width="67.35%" headers="mcps1.3.5.3.2.4.1.2 "><p id="obs_04_0098__p20610280">When initiating a multipart upload, you can use a header starting with <strong id="obs_04_0098__b14342076819330">x-obs-meta-</strong> in the HTTP request to define object metadata for easy management. The user-defined metadata will be returned in the response when you retrieve the object or query the object metadata. </p>
<p id="obs_04_0098__p51274795">Type: string</p>
<p id="obs_04_0098__p58819972">Example: <strong id="obs_04_0098__b2919173913572">x-obs-meta-test: test metadata</strong></p>
</td>
<td class="cellrowborder" valign="top" width="9.180000000000001%" headers="mcps1.3.5.3.2.4.1.3 "><p id="obs_04_0098__p66797252">No</p>
</td>
</tr>
</tbody>
</table>
</div>
<p class="msonormal" id="obs_04_0098__p66759527">For details about other common message headers, see <a href="obs_04_0007.html#obs_04_0007__table25197309">Table 3</a>.</p>
</div>
<div class="section" id="obs_04_0098__section9994560"><h4 class="sectiontitle">Request Elements</h4><p class="msonormal" id="obs_04_0098__p13769319">This request involves no elements.</p>
</div>
<div class="section" id="obs_04_0098__section22842176"><h4 class="sectiontitle">Response Syntax</h4><div class="codecoloring" codetype="Xml" id="obs_04_0098__screen49213403"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
<span class="normal"> 2</span>
<span class="normal"> 3</span>
<span class="normal"> 4</span>
<span class="normal"> 5</span>
<span class="normal"> 6</span>
<span class="normal"> 7</span>
<span class="normal"> 8</span>
<span class="normal"> 9</span>
<span class="normal">10</span>
<span class="normal">11</span></pre></div></td><td class="code"><div><pre><span></span>HTTP/1.1<span class="w"> </span>status_code
Date:<span class="w"> </span>date
Content-Length:<span class="w"> </span>length
Connection:<span class="w"> </span>status
<span class="cp">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;</span><span class="w"> </span>
<span class="nt">&lt;InitiateMultipartUploadResult</span><span class="w"> </span><span class="na">xmlns=</span><span class="s">&quot;http://obs.region.example.com/doc/2015-06-30/&quot;</span><span class="nt">&gt;</span>
<span class="w"> </span><span class="nt">&lt;Bucket&gt;</span>BucketName<span class="nt">&lt;/Bucket&gt;</span><span class="w"> </span>
<span class="w"> </span><span class="nt">&lt;Key&gt;</span>ObjectName<span class="nt">&lt;/Key&gt;</span><span class="w"> </span>
<span class="w"> </span><span class="nt">&lt;UploadId&gt;</span>uploadID<span class="nt">&lt;/UploadId&gt;</span><span class="w"> </span>
<span class="nt">&lt;/InitiateMultipartUploadResult&gt;</span><span class="w"> </span>
</pre></div></td></tr></table></div>
</div>
</div>
<div class="section" id="obs_04_0098__section4252992"><h4 class="sectiontitle">Response Headers</h4><p class="msonormal" id="obs_04_0098__p1512332591013">The response to the request uses common headers. For details, see <a href="obs_04_0013.html#obs_04_0013__d0e686">Table 1</a>.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="obs_04_0098__table28392596" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Additional response headers</caption><thead align="left"><tr id="obs_04_0098__row31751925"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.8.3.2.3.1.1"><p id="obs_04_0098__p21769118">Header</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.8.3.2.3.1.2"><p id="obs_04_0098__p18468132">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="obs_04_0098__row19523694"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.2.3.1.1 "><p id="obs_04_0098__p37915364">x-obs-server-side-encryption</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.2.3.1.2 "><p id="obs_04_0098__p51245680">This header is included in a response if SSE-KMS is used. </p>
<p id="obs_04_0098__p58557936">Type: string</p>
<p id="obs_04_0098__p57259383">Example: <strong id="obs_04_0098__b192321405914">x-obs-server-side-encryption:kms</strong></p>
</td>
</tr>
<tr id="obs_04_0098__row45572405"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.2.3.1.1 "><p id="obs_04_0098__p377347">x-obs-server-side-encryption-kms-key-id</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.2.3.1.2 "><p id="obs_04_0098__p30565121">Indicates the master key ID. This header is included in a response if SSE-KMS is used. </p>
<p id="obs_04_0098__p12270163863611">Type: string</p>
<p id="obs_04_0098__p9921152124913">Format: <em id="obs_04_0098__i1562119342514">regionID</em><strong id="obs_04_0098__b106217345513">:</strong><em id="obs_04_0098__i1862116341957">domainID</em><strong id="obs_04_0098__b11621133418511">:key/</strong><em id="obs_04_0098__i166223346518">key_id</em></p>
<p id="obs_04_0098__p127014384366"><em id="obs_04_0098__i694819525819">regionID</em> indicates the ID of the region where the key belongs. <em id="obs_04_0098__i294915545813">domainID</em> indicates the ID of the tenant where the key belongs. <em id="obs_04_0098__i69491351584">key_id</em> indicates the key ID used in this encryption.</p>
<p id="obs_04_0098__p995183135710">Example: <strong id="obs_04_0098__b10820162035816">x-obs-server-side-encryption-kms-key-id:</strong><em id="obs_04_0098__i159969471220">region</em><strong id="obs_04_0098__b134471824135816">:domainiddomainiddomainiddoma0001:key/4f1cd4de-ab64-4807-920a-47fc42e7f0d0</strong></p>
</td>
</tr>
<tr id="obs_04_0098__row59855703"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.2.3.1.1 "><p id="obs_04_0098__p16473774">x-obs-server-side-encryption-customer-algorithm</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.2.3.1.2 "><p id="obs_04_0098__p59307309">Indicates an encryption algorithm. This header is included in a response if SSE-C is used. </p>
<p id="obs_04_0098__p64003740">Type: string</p>
<p id="obs_04_0098__p39162749">Example: <strong id="obs_04_0098__b1150104918916">x-obs-server-side-encryption-customer-algorithm:AES256</strong></p>
</td>
</tr>
<tr id="obs_04_0098__row16920427"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.2.3.1.1 "><p id="obs_04_0098__p28377335">x-obs-server-side-encryption-customer-key-MD5</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.2.3.1.2 "><p id="obs_04_0098__p16862759">Indicates the MD5 value of a key used to encrypt objects. This header is included in a response if SSE-C is used. </p>
<p id="obs_04_0098__p17547104">Type: string</p>
<p id="obs_04_0098__p23706211">Example: <strong id="obs_04_0098__b975544918">x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==</strong></p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="obs_04_0098__section38276929"><h4 class="sectiontitle">Response Elements</h4><p class="msonormal" id="obs_04_0098__p41154964">This response contains elements to indicate the upload ID and the key (name) of the object (bucket) for which the multipart upload was initiated. The returned information is used in the subsequent operations. <a href="#obs_04_0098__table6651816">Table 4</a> describes the elements.</p>
<div class="tablenoborder"><a name="obs_04_0098__table6651816"></a><a name="table6651816"></a><table cellpadding="4" cellspacing="0" summary="" id="obs_04_0098__table6651816" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Response elements</caption><thead align="left"><tr id="obs_04_0098__row63652742"><th align="left" class="cellrowborder" valign="top" width="28.000000000000004%" id="mcps1.3.9.3.2.3.1.1"><p id="obs_04_0098__p55598486">Element</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="72%" id="mcps1.3.9.3.2.3.1.2"><p id="obs_04_0098__p64651485">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="obs_04_0098__row20510528"><td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.9.3.2.3.1.1 "><p id="obs_04_0098__p50740049">InitiateMultipartUploadResult</p>
</td>
<td class="cellrowborder" valign="top" width="72%" headers="mcps1.3.9.3.2.3.1.2 "><p id="obs_04_0098__p16303336">Container of a multipart upload task.</p>
<p id="obs_04_0098__p12512296">Type: XML</p>
</td>
</tr>
<tr id="obs_04_0098__row45501802"><td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.9.3.2.3.1.1 "><p id="obs_04_0098__p61767361">Bucket</p>
</td>
<td class="cellrowborder" valign="top" width="72%" headers="mcps1.3.9.3.2.3.1.2 "><p id="obs_04_0098__p37100373">Indicates the name of the bucket to which the multipart upload was initiated.</p>
<p id="obs_04_0098__p65467905">Type: string</p>
</td>
</tr>
<tr id="obs_04_0098__row52340237"><td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.9.3.2.3.1.1 "><p id="obs_04_0098__p11700818">Key</p>
</td>
<td class="cellrowborder" valign="top" width="72%" headers="mcps1.3.9.3.2.3.1.2 "><p id="obs_04_0098__p8242187">Indicates the object key in a multipart upload.</p>
<p id="obs_04_0098__p7070823">Type: string</p>
</td>
</tr>
<tr id="obs_04_0098__row63637409"><td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.9.3.2.3.1.1 "><p id="obs_04_0098__p54356475">UploadId</p>
</td>
<td class="cellrowborder" valign="top" width="72%" headers="mcps1.3.9.3.2.3.1.2 "><p id="obs_04_0098__p40798337">Indicates the ID for the initiated multipart upload. This ID is used for the subsequent operation.</p>
<p id="obs_04_0098__p31640721">Type: string</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="obs_04_0098__section8948044"><h4 class="sectiontitle">Error Responses</h4><p class="msonormal" id="obs_04_0098__p12761605">1. If the AK or signature is invalid, OBS returns <strong id="obs_04_0098__b13496736819">403 Forbidden</strong> and the error code is <strong id="obs_04_0098__b1717681310814">AccessDenied</strong>.</p>
<p class="msonormal" id="obs_04_0098__p47745588">2. If the bucket is not found, OBS returns <strong id="obs_04_0098__b66693333817">404 Not Found</strong> and the error code is <strong id="obs_04_0098__b68041439083">NoSuchBucket</strong>.</p>
<p class="msonormal" id="obs_04_0098__p27057114">3. Check whether the user has the write permission for the specified bucket. If no, OBS returns <strong id="obs_04_0098__b464718114910">403 Forbidden</strong> and the error code is <strong id="obs_04_0098__b1688114716910">AccessDenied</strong>.</p>
<p class="msonormal" id="obs_04_0098__p42187440">Other errors are included in <a href="obs_04_0115.html#obs_04_0115__d0e843">Table 2</a>.</p>
</div>
<div class="section" id="obs_04_0098__section14231133313369"><h4 class="sectiontitle">Sample Request: Initiating a Multipart Upload</h4><div class="codecoloring" codetype="Xml" id="obs_04_0098__screen1859153673612"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span>POST<span class="w"> </span>/objectkey?uploads<span class="w"> </span>HTTP/1.1<span class="w"> </span>
Host:<span class="w"> </span>examplebucket.obs.region.example.com
Date:<span class="w"> </span>WED,<span class="w"> </span>01<span class="w"> </span>Jul<span class="w"> </span>2015<span class="w"> </span>05:14:52<span class="w"> </span>GMT<span class="w"> </span>
Authorization:<span class="w"> </span>OBS<span class="w"> </span>AKIAIOSFODNN7EXAMPLE:VGhpcyBtZXNzYWdlIHNpZ25lZGGieSRlbHZpbmc=
</pre></div></td></tr></table></div>
</div>
</div>
<div class="section" id="obs_04_0098__section6143226163010"><h4 class="sectiontitle">Sample Response: Initiating a Multipart Upload</h4><div class="codecoloring" codetype="Xml" id="obs_04_0098__screen8391613101913"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
<span class="normal"> 2</span>
<span class="normal"> 3</span>
<span class="normal"> 4</span>
<span class="normal"> 5</span>
<span class="normal"> 6</span>
<span class="normal"> 7</span>
<span class="normal"> 8</span>
<span class="normal"> 9</span>
<span class="normal">10</span>
<span class="normal">11</span>
<span class="normal">12</span>
<span class="normal">13</span></pre></div></td><td class="code"><div><pre><span></span>HTTP/1.1<span class="w"> </span>200<span class="w"> </span>OK<span class="w"> </span>
Server:<span class="w"> </span>OBS
x-obs-id-2:<span class="w"> </span>Weag1LuByRx9e6j5Onimru9pO4ZVKnJ2Qz7/C1NPcfTWAtRPfTaOFg==<span class="w"> </span>
x-obs-request-id:<span class="w"> </span>996c76696e6727732072657175657374<span class="w"> </span>
Date:<span class="w"> </span>WED,<span class="w"> </span>01<span class="w"> </span>Jul<span class="w"> </span>2015<span class="w"> </span>05:14:52<span class="w"> </span>GMT
Content-Length:<span class="w"> </span>303
<span class="cp">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;</span><span class="w"> </span>
<span class="nt">&lt;InitiateMultipartUploadResult</span><span class="w"> </span><span class="na">xmlns=</span><span class="s">&quot;http://obs.region.example.com/doc/2015-06-30/&quot;</span><span class="nt">&gt;</span>
<span class="w"> </span><span class="nt">&lt;Bucket&gt;</span>bucketname<span class="nt">&lt;/Bucket&gt;</span><span class="w"> </span>
<span class="w"> </span><span class="nt">&lt;Key&gt;</span>objectkey<span class="nt">&lt;/Key&gt;</span><span class="w"> </span>
<span class="w"> </span><span class="nt">&lt;UploadId&gt;</span>DCD2FC98B4F70000013DF578ACA318E7<span class="nt">&lt;/UploadId&gt;</span><span class="w"> </span>
<span class="nt">&lt;/InitiateMultipartUploadResult&gt;</span>
</pre></div></td></tr></table></div>
</div>
</div>
<div class="section" id="obs_04_0098__section123644113018"><h4 class="sectiontitle">Sample Request: Initiating a Multipart Upload (with the ACL Configured)</h4><div class="codecoloring" codetype="Xml" id="obs_04_0098__screen746465893020"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span>POST<span class="w"> </span>/objectkey?uploads<span class="w"> </span>HTTP/1.1<span class="w"> </span>
Host:<span class="w"> </span>examplebucket.obs.region.example.com
Date:<span class="w"> </span>WED,<span class="w"> </span>01<span class="w"> </span>Jul<span class="w"> </span>2015<span class="w"> </span>05:15:43<span class="w"> </span>GMT
x-obs-grant-write-acp:ID=52f24s3593as5730ea4f722483579ai7,ID=a93fcas852f24s3596ea8366794f7224
Authorization:<span class="w"> </span>OBS<span class="w"> </span>AKIAIOSFODNN7EXAMPLE:VGhpcyBtZXNzYWdlIHNpZ25lZGGieSRlbHZpbmc=
</pre></div></td></tr></table></div>
</div>
</div>
<div class="section" id="obs_04_0098__section199516233110"><h4 class="sectiontitle">Sample Response: Initiating a Multipart Upload (with the ACL Configured)</h4><div class="codecoloring" codetype="Xml" id="obs_04_0098__screen18092664012"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
<span class="normal"> 2</span>
<span class="normal"> 3</span>
<span class="normal"> 4</span>
<span class="normal"> 5</span>
<span class="normal"> 6</span>
<span class="normal"> 7</span>
<span class="normal"> 8</span>
<span class="normal"> 9</span>
<span class="normal">10</span>
<span class="normal">11</span>
<span class="normal">12</span>
<span class="normal">13</span></pre></div></td><td class="code"><div><pre><span></span>HTTP/1.1<span class="w"> </span>200<span class="w"> </span>OK<span class="w"> </span>
Server:<span class="w"> </span>OBS
x-obs-id-2:<span class="w"> </span>32AAAQAAEAABAAAQAAEAABAAAQAAEAABCTnv+daB51p+IVhAvWN7s5rSKhcWqDFs<span class="w"> </span>
x-obs-request-id:<span class="w"> </span>BB78000001648457112DF37FDFADD7AD<span class="w"> </span>
Date:<span class="w"> </span>WED,<span class="w"> </span>01<span class="w"> </span>Jul<span class="w"> </span>2015<span class="w"> </span>05:15:43<span class="w"> </span>GMT
Content-Length:<span class="w"> </span>303
<span class="cp">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;</span><span class="w"> </span>
<span class="nt">&lt;InitiateMultipartUploadResult</span><span class="w"> </span><span class="na">xmlns=</span><span class="s">&quot;http://obs.region.example.com/doc/2015-06-30/&quot;</span><span class="nt">&gt;</span>
<span class="w"> </span><span class="nt">&lt;Bucket&gt;</span>bucketname<span class="nt">&lt;/Bucket&gt;</span><span class="w"> </span>
<span class="w"> </span><span class="nt">&lt;Key&gt;</span>objectkey<span class="nt">&lt;/Key&gt;</span><span class="w"> </span>
<span class="w"> </span><span class="nt">&lt;UploadId&gt;</span>000001648453845DBB78F2340DD460D8<span class="nt">&lt;/UploadId&gt;</span><span class="w"> </span>
<span class="nt">&lt;/InitiateMultipartUploadResult&gt;</span>
</pre></div></td></tr></table></div>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="obs_04_0096.html">Operations on Multipart Upload</a></div>
</div>
</div>