doc-exports/docs/obs/s3api/en-us_topic_0125560486.html
Jawei, Li 1a4c1a720a OBS s3api 2.0.38.SP5
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Jawei, Li <lijiawei5@huawei.com>
Co-committed-by: Jawei, Li <lijiawei5@huawei.com>
2022-11-16 14:51:13 +00:00

182 lines
18 KiB
HTML

<a name="EN-US_TOPIC_0125560486"></a><a name="EN-US_TOPIC_0125560486"></a>
<h1 class="topictitle1">Upload Part</h1>
<div id="body25569762"><p id="EN-US_TOPIC_0125560486__p119163233479">After initiating a multipart upload, you can use this operation to upload parts for the multipart upload using its <strong id="EN-US_TOPIC_0125560486__b10916102334712">uploadId</strong>.</p>
<p id="EN-US_TOPIC_0125560486__p25187424">In a multipart upload for a specific object, parts of the object can be uploaded in any sequence and multiple parts can be uploaded concurrently.</p>
<p id="EN-US_TOPIC_0125560486__p25360226">Part sizes range from 5 MB to 5 GB. However, in a <strong id="EN-US_TOPIC_0125560486__b51201854">complete multipart</strong> operation, the size of the last uploaded part must range from 0 to 5 GB. In addition, the <strong id="EN-US_TOPIC_0125560486__b58163509">uploadId</strong> of each part must be in the range of 1 to 10000.</p>
<p id="EN-US_TOPIC_0125560486__p5724003917518">This operation makes server-side encryption available.</p>
<div class="notice" id="EN-US_TOPIC_0125560486__note16587236162416"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0125560486__p112381047162417">When the same multipart of the same object is uploaded concurrently, the server complies with the Last Write Win policy.</p>
<p id="EN-US_TOPIC_0125560486__p202381847192413">The time of Last Write is the creation time of the multipart metadata. To ensure data security, you must add a lock to the client to ensure the upload consistency of the same multipart. There is no need to add a lock when different parts of the same object are uploaded.</p>
</div></div>
<div class="section" id="EN-US_TOPIC_0125560486__section11065523"><h4 class="sectiontitle">Request Syntax</h4><pre class="screen" id="EN-US_TOPIC_0125560486__screen12438252114129">PUT /ObjectName?partNumber=partNum&amp;uploadId=uploadID HTTP/1.1
User-Agent: agent
Host: bucketname.obs.example.com
Accept: */*
Date: date
Content-Length: Size
Authorization: Signature
Content-MD5: md5
Expect: expect</pre>
</div>
<div class="section" id="EN-US_TOPIC_0125560486__section32480848"><h4 class="sectiontitle">Request Parameters</h4><p id="EN-US_TOPIC_0125560486__p34064424">This request uses parameters to specify the ID of a multipart upload and part number. <a href="#EN-US_TOPIC_0125560486__table6481817">Table 1</a> describes the parameters.</p>
<div class="tablenoborder"><a name="EN-US_TOPIC_0125560486__table6481817"></a><a name="table6481817"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0125560486__table6481817" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Request parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0125560486__row40139983"><th align="left" class="cellrowborder" valign="top" width="27.532753275327533%" id="mcps1.3.7.3.2.4.1.1"><p id="EN-US_TOPIC_0125560486__p30113190">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="45.62456245624562%" id="mcps1.3.7.3.2.4.1.2"><p id="EN-US_TOPIC_0125560486__p23249317">Description</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="26.842684268426847%" id="mcps1.3.7.3.2.4.1.3"><p id="EN-US_TOPIC_0125560486__p4146549">Remarks</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0125560486__row326206"><td class="cellrowborder" valign="top" width="27.532753275327533%" headers="mcps1.3.7.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560486__p26422695">partNumber</p>
</td>
<td class="cellrowborder" valign="top" width="45.62456245624562%" headers="mcps1.3.7.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560486__p59863512">Indicates the number that identifies a part to be uploaded. It can be any number from 1 to 10,000</p>
<p id="EN-US_TOPIC_0125560486__p1900699">Type: Integer</p>
</td>
<td class="cellrowborder" valign="top" width="26.842684268426847%" headers="mcps1.3.7.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560486__p19738956">Mandatory</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0125560486__row43432884"><td class="cellrowborder" valign="top" width="27.532753275327533%" headers="mcps1.3.7.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560486__p28402735">uploadId</p>
</td>
<td class="cellrowborder" valign="top" width="45.62456245624562%" headers="mcps1.3.7.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560486__p18920211">Indicates the ID of a multipart upload.</p>
<p id="EN-US_TOPIC_0125560486__p36064171">Type: String</p>
</td>
<td class="cellrowborder" valign="top" width="26.842684268426847%" headers="mcps1.3.7.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560486__p35516734">Mandatory</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0125560486__section23892180"><h4 class="sectiontitle">Request Headers</h4><p id="EN-US_TOPIC_0125560486__p54786880">This request uses common headers. For details about common request headers, see section <a href="en-us_topic_0125560462.html">Common Request Headers</a>.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0125560486__table64989796103741" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request Headers</caption><thead align="left"><tr id="EN-US_TOPIC_0125560486__row15560039103741"><th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.8.3.2.4.1.1"><p id="EN-US_TOPIC_0125560486__p45145935103825">Header</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.8.3.2.4.1.2"><p id="EN-US_TOPIC_0125560486__p32942147103825">Description</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.8.3.2.4.1.3"><p id="EN-US_TOPIC_0125560486__p51068251103825">Remarks</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0125560486__row60209390103741"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.8.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560486__p851681417555">x-amz-server-side-encryption-customer-algorithm</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.8.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560486__p1877331917555">Indicates an encryption algorithm. The header is used in SSE-C mode.</p>
<p id="EN-US_TOPIC_0125560486__p3474214717555">Type: string</p>
<p id="EN-US_TOPIC_0125560486__p4424386917555">Example: x-amz-server-side-encryption-customer-algorithm:AES256</p>
<p id="EN-US_TOPIC_0125560486__p6265050217555">Constraints: This header must be used together with <strong id="EN-US_TOPIC_0125560486__b2698360717555">x-amz-server-side-encryption-customer-key</strong> and <strong id="EN-US_TOPIC_0125560486__b4152587317555">x-amz-server-side-encryption-customer-key-MD5</strong>.</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.8.3.2.4.1.3 "><p style="color:#FF0000;" id="EN-US_TOPIC_0125560486__p29781360103758"><span style="color:#000000;">No. This header is mandatory when customer-provided keys are used.</span></p>
</td>
</tr>
<tr id="EN-US_TOPIC_0125560486__row12202830103741"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.8.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560486__p626415317555">x-amz-server-side-encryption-customer-key</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.8.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560486__p3763435217555">Indicates a key used to encrypt objects. The header is used in SSE-C mode.</p>
<p id="EN-US_TOPIC_0125560486__p316485417555">Type: string</p>
<p id="EN-US_TOPIC_0125560486__p2848369217555">Example: x-amz-server-side-encryption-customer-key:K7QkYpBkM5+hcs27fsNkUnNVaobncnLht/rCB2o/9Cw=</p>
<p id="EN-US_TOPIC_0125560486__p5502664417555">Constraints: This header is a base64-encoded 256-bit or 512-bit key and must be used together with <strong id="EN-US_TOPIC_0125560486__b2547774917555">x-amz-server-side-encryption-customer-algorithm</strong> and <strong id="EN-US_TOPIC_0125560486__b2797315417555">x-amz-server-side-encryption-customer-key-MD5</strong>.</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.8.3.2.4.1.3 "><p style="color:#FF0000;" id="EN-US_TOPIC_0125560486__p21180961103758"><span style="color:#000000;">No. This header is mandatory when customer-provided keys are used.</span></p>
</td>
</tr>
<tr id="EN-US_TOPIC_0125560486__row37964325103741"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.8.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560486__p5844353217555">x-amz-server-side-encryption-customer-key-MD5</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.8.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560486__p3630564217555">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="EN-US_TOPIC_0125560486__p5831532617555">Type: string</p>
<p id="EN-US_TOPIC_0125560486__p5507589317555">Example: x-amz-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==</p>
<p id="EN-US_TOPIC_0125560486__p2592099017555">Constraints: This header is a base64-encoded 128-bit MD5 value and must be used together with <strong id="EN-US_TOPIC_0125560486__b3196232417555">x-amz-server-side-encryption-customer-algorithm</strong> and <strong id="EN-US_TOPIC_0125560486__b1922546317555">x-amz-server-side-encryption-customer-key</strong>.</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.8.3.2.4.1.3 "><p style="color:#FF0000;" id="EN-US_TOPIC_0125560486__p9355952103758"><span style="color:#000000;">No. This header is mandatory when customer-provided keys are used.</span></p>
</td>
</tr>
<tr id="EN-US_TOPIC_0125560486__row214861134013"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.8.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560486__p634621224018">x-amz-security-token</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.8.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560486__p834691215402">Header field used to identify the request of a federated user. When the federal authentication function is enabled, users sending such requests are identified as federated users.</p>
<p id="EN-US_TOPIC_0125560486__p5346512184013">Type: string</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.8.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560486__p1434621216403">Optional. This parameter must be carried in the request sent by federated users.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0125560486__section13703032"><h4 class="sectiontitle">Request Elements</h4><p id="EN-US_TOPIC_0125560486__p21645851">This request involves no elements.</p>
</div>
<div class="section" id="EN-US_TOPIC_0125560486__section1842005"><h4 class="sectiontitle">Response Syntax</h4><pre class="screen" id="EN-US_TOPIC_0125560486__screen25359650114146">HTTP/1.1 status_code
x-amz-id-2: id
x-amz-request-id: request id
x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc
Date: date
ETag: etagValue
Content-Length: length
Server: server</pre>
</div>
<div class="section" id="EN-US_TOPIC_0125560486__section16578052"><h4 class="sectiontitle">Response Headers</h4><p id="EN-US_TOPIC_0125560486__p27782053">This response uses common headers. For details about common response headers, see section <a href="en-us_topic_0125560484.html">Common Response Headers</a>.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0125560486__table5987923310397" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Response Headers</caption><thead align="left"><tr id="EN-US_TOPIC_0125560486__row6148827010397"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.11.3.2.3.1.1"><p id="EN-US_TOPIC_0125560486__p42968163103932">Header</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.11.3.2.3.1.2"><p id="EN-US_TOPIC_0125560486__p57869165103932">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0125560486__row158288710397"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.11.3.2.3.1.1 "><p id="EN-US_TOPIC_0125560486__p3127668017642">x-amz-server-side-encryption</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.11.3.2.3.1.2 "><p id="EN-US_TOPIC_0125560486__p5038316017642">This header is included in a response if SSE-KMS is used.</p>
<p id="EN-US_TOPIC_0125560486__p5079525817642">Type: string</p>
<p id="EN-US_TOPIC_0125560486__p5450414017642">Example: x-amz-server-side-encryption:aws:kms</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0125560486__row5241401610397"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.11.3.2.3.1.1 "><p id="EN-US_TOPIC_0125560486__p507086917642">x-amz-server-side-encryption-aws-kms-key-id</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.11.3.2.3.1.2 "><p id="EN-US_TOPIC_0125560486__p808725117642">Indicates the master key ID. This header is included in a response if SSE-KMS is used.</p>
<p id="EN-US_TOPIC_0125560486__p567640317642">Example: x-amz-server-side-encryption-aws-kms-key-id:arn:aws:kms:sichuan:domainiddomainiddomainiddoma0001:key/4f1cd4de-ab64-4807-920a-47fc42e7f0d0</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0125560486__row157267910397"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.11.3.2.3.1.1 "><p id="EN-US_TOPIC_0125560486__p4445772217642">x-amz-server-side-encryption-customer-algorithm</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.11.3.2.3.1.2 "><p id="EN-US_TOPIC_0125560486__p4430571417642">Indicates an encryption algorithm. This header is included in a response if SSE-C is used.</p>
<p id="EN-US_TOPIC_0125560486__p6320710717642">Type: string</p>
<p id="EN-US_TOPIC_0125560486__p3199305817642">Example: x-amz-server-side-encryption-customer-algorithm:AES256</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0125560486__row5359392110397"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.11.3.2.3.1.1 "><p id="EN-US_TOPIC_0125560486__p3616391917642">x-amz-server-side-encryption-customer-key-MD5</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.11.3.2.3.1.2 "><p id="EN-US_TOPIC_0125560486__p4359634017642">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="EN-US_TOPIC_0125560486__p5682274217642">Type: string</p>
<p id="EN-US_TOPIC_0125560486__p4164263717642">Example: x-amz-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0125560486__section14984742"><h4 class="sectiontitle">Response Elements</h4><p id="EN-US_TOPIC_0125560486__p10378914">This response involves no elements.</p>
</div>
<div class="section" id="EN-US_TOPIC_0125560486__section644958"><h4 class="sectiontitle">Error Responses</h4><ul id="EN-US_TOPIC_0125560486__ul137841827112613"><li id="EN-US_TOPIC_0125560486__li72021802710">If the part number exceeds the range of 1 to 10,000, OBS returns status code <strong id="EN-US_TOPIC_0125560486__b192807438275">400 Bad Request</strong>.</li><li id="EN-US_TOPIC_0125560486__li1192441952710">If the part size is greater than 5 GB, OBS returns status code <strong id="EN-US_TOPIC_0125560486__b14719047162719">400 Bad Request</strong>.</li><li id="EN-US_TOPIC_0125560486__li58141921122715">If an AK or signature is invalid, OBS returns status code <strong id="EN-US_TOPIC_0125560486__b023112525279">403 Forbidden</strong> and error code <strong id="EN-US_TOPIC_0125560486__b10817956152715">AccessDenied</strong>.</li><li id="EN-US_TOPIC_0125560486__li119349234278">If the requested bucket does not exist, OBS returns status code <strong id="EN-US_TOPIC_0125560486__b880464122814">404 Not Found</strong> and error code <strong id="EN-US_TOPIC_0125560486__b18202100202820">NoSuchBucket</strong>.</li><li id="EN-US_TOPIC_0125560486__li293313250278">If the requester does not have <strong id="EN-US_TOPIC_0125560486__b15252934101615">READ</strong> permission for the requested bucket, OBS returns status code <strong id="EN-US_TOPIC_0125560486__b35984120284">403 Forbidden</strong> and error code <strong id="EN-US_TOPIC_0125560486__b69342015172815">AccessDenied</strong>.</li><li id="EN-US_TOPIC_0125560486__li164743288277">If the requested multipart upload does not exist, OBS returns status code <strong id="EN-US_TOPIC_0125560486__b962414396165">404 Not Found</strong> and error code <strong id="EN-US_TOPIC_0125560486__b2942141952816">NoSuchUpload</strong>.</li><li id="EN-US_TOPIC_0125560486__li27841027182612">If the requester is not the initiator of the multipart upload, OBS returns status code <strong id="EN-US_TOPIC_0125560486__b3991182813283">403 Forbidden</strong> and error code <strong id="EN-US_TOPIC_0125560486__b142641431182813">AccessDenied</strong>.</li></ul>
<p id="EN-US_TOPIC_0125560486__p58267878">For details about other error responses, see <a href="en-us_topic_0125560440.html#EN-US_TOPIC_0125560440__table30733758">Table 1</a>.</p>
</div>
<div class="section" id="EN-US_TOPIC_0125560486__section23819137"><h4 class="sectiontitle">Sample Request</h4><pre class="screen" id="EN-US_TOPIC_0125560486__screen2806767911424">PUT /ObjectName?partNumber=1&amp;uploadId=VCVsb2FkIElEIGZvciBlbZZpbmcncyBteS1tb3ZpZS5tMnRzIHVwbG9hZR HTTP/1.1
User-Agent: Jakarta Commons-HttpClient/3.1
Host: bucketname.obs.example.com
Accept: */*
Date: Mon, 1 Nov 2010 20:34:56 GMT
Content-Length: 1048596
Authorization:AWS 14RZT432N80TGDF2Y2G2:8se2hm3YLchJhuPMDrybeITcuo0=
Content-MD5:q3q7DaS8pTI6thGbtdzSlg==</pre>
</div>
<div class="section" id="EN-US_TOPIC_0125560486__section13045645"><h4 class="sectiontitle">Sample Response</h4><pre class="screen" id="EN-US_TOPIC_0125560486__screen26012437114210">HTTP/1.1 200 OK
x-amz-id-2: Vvag1LuByRx9e6j5Onimru9pO4ZVKnJ2Qz7/C1NPcfTWAtRPfTaOFg==
x-amz-request-id: 656c76696e6727732072657175657374
x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc
Date: Mon, 1 Nov 2010 20:34:56 GMT
ETag: "b54357faf0632cce46e942fa68356b38"
Content-Length: 1048596</pre>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0125560489.html">Operations on Objects</a></div>
</div>
</div>