forked from docs/doc-exports
Reviewed-by: Sabelnikov, Dmitriy <dmitriy.sabelnikov@t-systems.com> Co-authored-by: zhangyue <zhangyue164@huawei.com> Co-committed-by: zhangyue <zhangyue164@huawei.com>
186 lines
18 KiB
HTML
186 lines
18 KiB
HTML
<a name="obs_04_0099"></a><a name="obs_04_0099"></a>
|
|
|
|
<h1 class="topictitle1">Uploading Parts</h1>
|
|
<div id="body47090749"><div class="section" id="obs_04_0099__section5584184924715"><h4 class="sectiontitle">Functions</h4><p class="msonormal" id="obs_04_0099__p35066376">After initiating a multipart upload, you can use this operation to upload parts for the multipart upload using its task ID. When parts are uploaded in a multipart upload of an object, the upload sequence does not affect part merging, namely, multiple parts can be uploaded concurrently.</p>
|
|
<p class="msonormal" id="obs_04_0099__p47161933">Part sizes range from 100 KB to 5 GB. However, when parts are being merged, the size of the last uploaded part ranges from 0 to 5 GB. The upload part ID ranges from 1 to 10,000.</p>
|
|
<p class="msonormal" id="obs_04_0099__p21804221">This operation supports server-side encryption.</p>
|
|
<div class="notice" id="obs_04_0099__note21311462"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p class="cautiontext" id="obs_04_0099__p21163563">The value of <strong id="obs_04_0099__b2309841157">partNumber</strong> in a multipart task is unique. If you upload a part of the same <strong id="obs_04_0099__b46531132121512">partNumber</strong> repeatedly, the last part uploaded will overwrite the previous one. When multiple concurrent uploading of the same <strong id="obs_04_0099__b6982162951612">partNumber</strong> part of the same object is performed, the Last Write Win policy is applied. The time of <strong id="obs_04_0099__b560211143175">Last Write</strong> is defined as the time when the metadata of the part is created. To ensure data accuracy, the client must be locked to ensure concurrent upload of the same part of the same object. Concurrent upload of different parts of the same object does not need to be locked.</p>
|
|
</div></div>
|
|
</div>
|
|
<div class="section" id="obs_04_0099__section57585434"><h4 class="sectiontitle">Request Syntax</h4><pre class="screen" id="obs_04_0099__screen42029491">PUT /ObjectName?partNumber=partNum&uploadId=uploadID HTTP/1.1
|
|
Host: <em id="obs_04_0099__i123441746202313">bucketname</em>.obs.<em id="obs_04_0099__i034434682311">region</em>.example.com
|
|
Date: <em id="obs_04_0099__i8395995">date</em>
|
|
Content-Length: length
|
|
Authorization: <em id="obs_04_0099__i13774005">authorization</em>
|
|
Content-MD5:<em id="obs_04_0099__i27511718141812">md5</em>
|
|
<object Content></pre>
|
|
</div>
|
|
<div class="section" id="obs_04_0099__section48506860"><h4 class="sectiontitle">Request Parameters</h4><p class="msonormal" id="obs_04_0099__p48945599">This request uses parameters to specify the upload task ID and part number. <a href="#obs_04_0099__table6481817">Table 1</a> describes the parameters.</p>
|
|
|
|
<div class="tablenoborder"><a name="obs_04_0099__table6481817"></a><a name="table6481817"></a><table cellpadding="4" cellspacing="0" summary="" id="obs_04_0099__table6481817" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Request parameters</caption><thead align="left"><tr id="obs_04_0099__row58839615"><th align="left" class="cellrowborder" valign="top" width="24.240000000000002%" id="mcps1.3.3.3.2.4.1.1"><p id="obs_04_0099__p1279523">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_0099__p60357070">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_0099__p43998544">Mandatory</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="obs_04_0099__row64010643"><td class="cellrowborder" valign="top" width="24.240000000000002%" headers="mcps1.3.3.3.2.4.1.1 "><p id="obs_04_0099__p17479560">partNumber</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="56.57%" headers="mcps1.3.3.3.2.4.1.2 "><p id="obs_04_0099__p6558233">Indicates the ID of a part to be uploaded. The value is an integer from 1 to 10000.</p>
|
|
<p id="obs_04_0099__p59024104">Type: integer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.189999999999998%" headers="mcps1.3.3.3.2.4.1.3 "><p id="obs_04_0099__p16223152">Yes</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0099__row11790642"><td class="cellrowborder" valign="top" width="24.240000000000002%" headers="mcps1.3.3.3.2.4.1.1 "><p id="obs_04_0099__p15517961">uploadId</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="56.57%" headers="mcps1.3.3.3.2.4.1.2 "><p id="obs_04_0099__p48995357">Indicates a multipart upload ID.</p>
|
|
<p id="obs_04_0099__p38305033">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_0099__p15699970">Yes</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0099__section33908557"><h4 class="sectiontitle">Request Headers</h4><p class="msonormal" id="obs_04_0099__p63738092">This request uses common headers. For details, see <a href="obs_04_0007.html#obs_04_0007__table25197309">Table 3</a>.</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="obs_04_0099__table62511855" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Server encryption request headers</caption><thead align="left"><tr id="obs_04_0099__row63573861"><th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.4.3.2.4.1.1"><p id="obs_04_0099__p49209084">Header</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.4.3.2.4.1.2"><p id="obs_04_0099__p26512888">Description</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.4.3.2.4.1.3"><p id="obs_04_0099__p60353">Mandatory</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="obs_04_0099__row4888638"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.3.2.4.1.1 "><p id="obs_04_0099__p60435416">x-obs-server-side-encryption-customer-algorithm</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.3.2.4.1.2 "><p id="obs_04_0099__p63430518">Indicates an encryption algorithm. The header is used in SSE-C mode.</p>
|
|
<p id="obs_04_0099__p34003754">Type: string</p>
|
|
<p id="obs_04_0099__p37598337">Example: <strong id="obs_04_0099__b1511920106">x-obs-server-side-encryption-customer-algorithm:AES256</strong></p>
|
|
<p id="obs_04_0099__p2840714">Constraint: This header must be used together with <strong id="obs_04_0099__b1469743013115">x-obs-server-side-encryption-customer-key</strong> and <strong id="obs_04_0099__b6704163010114">x-obs-server-side-encryption-customer-key-MD5</strong>.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.3.2.4.1.3 "><p id="obs_04_0099__p28771299">No. This header is required when SSE-C is used. The encryption algorithm must be the same as that used to initiate multipart upload tasks.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0099__row57615100"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.3.2.4.1.1 "><p id="obs_04_0099__p36311484">x-obs-server-side-encryption-customer-key</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.3.2.4.1.2 "><p id="obs_04_0099__p55549064">Indicates a 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_0099__p30179535">Type: string</p>
|
|
<p id="obs_04_0099__p3180361">Example: <strong id="obs_04_0099__b841667111020">x-obs-server-side-encryption-customer-key:K7QkYpBkM5+hca27fsNkUnNVaobncnLht/rCB2o/9Cw=</strong></p>
|
|
<p id="obs_04_0099__p28623257">Constraint: This header is a Base64-encoded 256-bit key and must be used together with <strong id="obs_04_0099__b16861104216191">x-obs-server-side-encryption-customer-algorithm</strong> and <strong id="obs_04_0099__b7862164201914">x-obs-server-side-encryption-customer-key-MD5</strong>.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.3.2.4.1.3 "><p id="obs_04_0099__p36782500">No. This header is required when SSE-C is used. The key must be the same as that used to initiate multipart upload tasks.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0099__row62607049"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.3.2.4.1.1 "><p id="obs_04_0099__p38006232">x-obs-server-side-encryption-customer-key-MD5</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.3.2.4.1.2 "><p id="obs_04_0099__p58605947">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_0099__p57691480">Type: string</p>
|
|
<p id="obs_04_0099__p49461275">Example: <strong id="obs_04_0099__b189842011101012">x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==</strong></p>
|
|
<p id="obs_04_0099__p42498293">Constraint: This header is a Base64-encoded 128-bit MD5 value and must be used together with <strong id="obs_04_0099__b738405512013">x-obs-server-side-encryption-customer-algorithm</strong> and <strong id="obs_04_0099__b1539075515013">x-obs-server-side-encryption-customer-key</strong>.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.3.2.4.1.3 "><p id="obs_04_0099__p19809690">No. This header is required when SSE-C is used. The MD5 value must be the same as that used to initiate multipart upload tasks.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0099__section36741558"><h4 class="sectiontitle">Request Elements</h4><p class="msonormal" id="obs_04_0099__p61081072">This request involves no elements.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0099__section62238568"><h4 class="sectiontitle">Response Syntax</h4><div class="codecoloring" codetype="Xml" id="obs_04_0099__screen35591885"><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>HTTP/1.1<span class="w"> </span>status_code
|
|
Date:<span class="w"> </span>date
|
|
ETag:<span class="w"> </span>etag
|
|
Content-Length:<span class="w"> </span>length
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0099__section23276204"><h4 class="sectiontitle">Response Headers</h4><p class="msonormal" id="obs_04_0099__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_0099__table16935586" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Additional response headers</caption><thead align="left"><tr id="obs_04_0099__row26922726"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.7.3.2.3.1.1"><p id="obs_04_0099__p33257168">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_0099__p9476070">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="obs_04_0099__row29364242"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.7.3.2.3.1.1 "><p id="obs_04_0099__p29693369">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_0099__p56352709">This header is included in a response if SSE-KMS is used. </p>
|
|
<p id="obs_04_0099__p37412341">Type: string</p>
|
|
<p id="obs_04_0099__p1166750">Example: <strong id="obs_04_0099__b1825611631018">x-obs-server-side-encryption:kms</strong></p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0099__row10500755"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.7.3.2.3.1.1 "><p id="obs_04_0099__p45254793">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_0099__p41759616">Indicates the master key ID. This header is included in a response if SSE-KMS is used. </p>
|
|
<p id="obs_04_0099__p36311057123619">Type: string</p>
|
|
<p id="obs_04_0099__p12143184595018">Format: <em id="obs_04_0099__i1885113918520">regionID</em><strong id="obs_04_0099__b20857939450">:</strong><em id="obs_04_0099__i88575391155">domainID</em><strong id="obs_04_0099__b19858203910516">:key/</strong><em id="obs_04_0099__i158589390510">key_id</em></p>
|
|
<p id="obs_04_0099__p116312573364"><em id="obs_04_0099__i159641435185817">regionID</em> indicates the ID of the region where the key belongs. <em id="obs_04_0099__i1696514350583">domainID</em> indicates the ID of the tenant where the key belongs. <em id="obs_04_0099__i296511359581">key_id</em> indicates the key ID used in this encryption.</p>
|
|
<p id="obs_04_0099__p113127905815">Example: <strong id="obs_04_0099__b26110381804">x-obs-server-side-encryption-kms-key-id:</strong><strong id="obs_04_0099__b11635387011"><em id="obs_04_0099__i206314388010">region</em></strong><strong id="obs_04_0099__b11648380013">:domainiddomainiddomainiddoma0001:key/4f1cd4de-ab64-4807-920a-47fc42e7f0d0</strong></p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0099__row27085727"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.7.3.2.3.1.1 "><p id="obs_04_0099__p46460303">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_0099__p5188216">Indicates an encryption algorithm. This header is included in a response if SSE-C is used. </p>
|
|
<p id="obs_04_0099__p46693945">Type: string</p>
|
|
<p id="obs_04_0099__p17592321">Example: <strong id="obs_04_0099__b39642591017">x-obs-server-side-encryption-customer-algorithm:AES256</strong></p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0099__row24113161"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.7.3.2.3.1.1 "><p id="obs_04_0099__p7008997">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_0099__p30857910">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_0099__p9285742">Type: string</p>
|
|
<p id="obs_04_0099__p16462820">Example: <strong id="obs_04_0099__b128011301104">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_0099__section8159252"><h4 class="sectiontitle">Response Elements</h4><p class="msonormal" id="obs_04_0099__p58420054">This response involves no elements.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0099__section6324408"><h4 class="sectiontitle">Error Responses</h4><ol id="obs_04_0099__ol19370155971011"><li class="msonormal" id="obs_04_0099__li9346162171114">If a part number is not within the range from 1 to 10000, OBS returns <strong id="obs_04_0099__b447120499213">400 Bad Request</strong>.</li><li class="msonormal" id="obs_04_0099__li3800147114">If a part size has exceeded 5 GB, the error code <strong id="obs_04_0099__b1619951719227">400 Bad Request</strong> is returned.</li><li class="msonormal" id="obs_04_0099__li1176471115">If the AK or signature is invalid, OBS returns <strong id="obs_04_0099__b5791236152220">403 Forbidden</strong> and the error code is <strong id="obs_04_0099__b102301943202218">AccessDenied</strong>.</li><li class="msonormal" id="obs_04_0099__li62881411101110">Check whether the bucket exists. If the bucket is not found, OBS returns <strong id="obs_04_0099__b1112115112239">404 Not Found</strong> and the error code is <strong id="obs_04_0099__b5658187102315">NoSuchBucket</strong>.</li><li class="msonormal" id="obs_04_0099__li398421318117">View the bucket ACL to check whether the user has the read permission for the requested bucket. If the user does not have the read permission, OBS returns <strong id="obs_04_0099__b7748103113234">403 AccessDenied</strong>.</li><li class="msonormal" id="obs_04_0099__li1382420165111">Check whether the multipart upload task exists. If the task does not exist, OBS returns <strong id="obs_04_0099__b167811456142311">404 Not Found</strong> and the error code is <strong id="obs_04_0099__b13020442414">NoSuchUpload</strong>.</li><li class="msonormal" id="obs_04_0099__li10370459191018">Check whether the request user is the initiator of the multipart upload task. If not, OBS returns <strong id="obs_04_0099__b624211212248">403 Forbidden</strong> and the error code is <strong id="obs_04_0099__b684629112419">AccessDenied</strong>.</li></ol>
|
|
<p class="msonormal" id="obs_04_0099__p47007439">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_0099__section1791150144618"><h4 class="sectiontitle">Sample Request</h4><pre class="screen" id="obs_04_0099__screen1757694184618">PUT /object02?partNumber=1&uploadId=00000163D40171ED8DF4050919BD02B8 HTTP/1.1
|
|
User-Agent: curl/7.29.0
|
|
Host: examplebucket.obs.<em id="obs_04_0099__i12367117502">region</em>.example.com
|
|
Accept: */*
|
|
Date: WED, 01 Jul 2015 05:15:55 GMT
|
|
Authorization: OBS H4IPJX0TQTHTHEBQQCEC:ZB0hFwaHubi1aKHv7dSZjJts40g=
|
|
Content-Length: 102015348
|
|
|
|
[102015348 Byte part content]</pre>
|
|
</div>
|
|
<div class="section" id="obs_04_0099__section1649818566470"><h4 class="sectiontitle">Sample Response</h4><div class="codecoloring" codetype="Xml" id="obs_04_0099__screen152195618473"><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></pre></div></td><td class="code"><div><pre><span></span>HTTP/1.1<span class="w"> </span>200<span class="w"> </span>OK
|
|
Server:<span class="w"> </span>OBS
|
|
x-obs-request-id:<span class="w"> </span>8DF400000163D40956A703289CA066F1
|
|
ETag:<span class="w"> </span>"b026324c6904b2a9cb4b88d6d61c81d1"
|
|
x-obs-id-2:<span class="w"> </span>32AAAQAAEAABAAAQAAEAABAAAQAAEAABCUQu/EOEVSMa04GXVwy0z9WI+BsDKvfh
|
|
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:55<span class="w"> </span>GMT
|
|
Content-Length:<span class="w"> </span>0
|
|
</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>
|
|
|