doc-exports/docs/obs/api-ref/obs_04_0098.html
zhangyue f61b26432c 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-07-25 08:23:43 +00:00

394 lines
36 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__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.3.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.3.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.3.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.3.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.3.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.3.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.4.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.4.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.4.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.4.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.4.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.4.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.4.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.4.3.2.4.1.2 "><p id="obs_04_0098__p1041152010375">When initiating a multipart upload, you can use this header to authorize all users in an account 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.4.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.4.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.4.3.2.4.1.2 "><p id="obs_04_0098__p6913194219811">When initiating a multipart upload, you can use this header to authorize 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.4.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.4.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.4.3.2.4.1.2 "><p id="obs_04_0098__p94031856283">When initiating a multipart upload, you can use this header to authorize 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.4.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.4.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.4.3.2.4.1.2 "><p id="obs_04_0098__p1914315101898">When initiating a multipart upload, you can use this header to authorize all users in an account to read the object, obtain the object metadata, obtain the object 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.4.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.4.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.4.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.4.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.4.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.4.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.4.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.4.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.4.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.4.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.4.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.4.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, the system 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">1. <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">2. <em id="obs_04_0098__i207501714175511">key_id</em></p>
<p id="obs_04_0098__p558627121315"><em id="obs_04_0098__i18899203616413">regionID</em> is the ID of the region to which the key belongs. <em id="obs_04_0098__i149056363419">domainID</em> is the account ID of the tenant to which the key belongs. <em id="obs_04_0098__i1790519366412">key_id</em> is the key ID created in KMS.</p>
<p id="obs_04_0098__p17830152818144">Example:</p>
<p id="obs_04_0098__p183251365619">1. x-obs-server-side-encryption-kms-key-id:<em id="obs_04_0098__i246192715581">region</em>:domainiddomainiddomainiddoma0001:key/4f1cd4de-ab64-4807-920a-47fc42e7f0d0</p>
<p id="obs_04_0098__p53311133560">2. x-obs-server-side-encryption-kms-key-id:4f1cd4de-ab64-4807-920a-47fc42e7f0d0</p>
</td>
<td class="cellrowborder" valign="top" width="9.180000000000001%" headers="mcps1.3.4.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.4.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.4.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.4.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.4.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.4.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.4.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.4.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.4.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.4.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.4.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.4.3.2.4.1.2 "><p id="obs_04_0098__p13631435204018">Indicates the expiration time of an object, in days. An object will be automatically deleted once it expires (calculated from the last modification time of the object).</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.4.3.2.4.1.3 "><p id="obs_04_0098__p1014357105719">No</p>
</td>
</tr>
<tr id="obs_04_0098__row110622973915"><td class="cellrowborder" valign="top" width="23.47%" headers="mcps1.3.4.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.4.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.4.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.7.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.7.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.7.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.7.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.7.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.7.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__i438315561142">regionID</em> is the ID of the region to which the key belongs. <em id="obs_04_0098__i123841556171415">domainID</em> is the account ID of the tenant to which the key belongs. <em id="obs_04_0098__i2384185611410">key_id</em> is the key ID used in this encryption.</p>
<p id="obs_04_0098__p995183135710">Example: x-obs-server-side-encryption-kms-key-id:<em id="obs_04_0098__i159969471220">region</em>:domainiddomainiddomainiddoma0001:key/4f1cd4de-ab64-4807-920a-47fc42e7f0d0</p>
</td>
</tr>
<tr id="obs_04_0098__row59855703"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.7.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.7.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.7.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.7.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.8.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.8.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.8.3.2.3.1.1 "><p id="obs_04_0098__p50740049">InitiateMultipartUploadResult</p>
</td>
<td class="cellrowborder" valign="top" width="72%" headers="mcps1.3.8.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.8.3.2.3.1.1 "><p id="obs_04_0098__p61767361">Bucket</p>
</td>
<td class="cellrowborder" valign="top" width="72%" headers="mcps1.3.8.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.8.3.2.3.1.1 "><p id="obs_04_0098__p11700818">Key</p>
</td>
<td class="cellrowborder" valign="top" width="72%" headers="mcps1.3.8.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.8.3.2.3.1.1 "><p id="obs_04_0098__p54356475">UploadId</p>
</td>
<td class="cellrowborder" valign="top" width="72%" headers="mcps1.3.8.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 1</h4><p id="obs_04_0098__p187918216189"><strong id="obs_04_0098__b3535123417288">Initialize a multipart task.</strong></p>
<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 1</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 2</h4><p id="obs_04_0098__p175194593016"><strong id="obs_04_0098__b1513344182810">The ACL is carried when the multipart task is initialized.</strong></p>
<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 2</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>