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>
630 lines
56 KiB
HTML
630 lines
56 KiB
HTML
<a name="obs_04_0080"></a><a name="obs_04_0080"></a>
|
|
|
|
<h1 class="topictitle1">Uploading an Object - PUT</h1>
|
|
<div id="body25727187"><div class="section" id="obs_04_0080__section5584184924715"><h4 class="sectiontitle">Functions</h4><p class="msonormal" id="obs_04_0080__p57130901">After creating a bucket in OBS, you can use this operation to upload an object to the bucket. This operation uploads an object to a bucket. To use this operation, you must have the write permission for the bucket.</p>
|
|
<div class="note" id="obs_04_0080__note44416069"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p class="text" id="obs_04_0080__p30218092">The name of each object in a bucket must be unique.</p>
|
|
</div></div>
|
|
<p class="msonormal" id="obs_04_0080__p148472556134">With versioning not enabled, if an object to be uploaded has the same name as an existing object in the bucket, the newly uploaded object will overwrite the existing one. To protect data from being corrupted during transmission, you can add the <strong id="obs_04_0080__b736611115814">Content-MD5</strong> header in the request. After receiving the uploaded object, OBS compares the provided MD5 value to the MD5 value it calculates. If the two values do not match, OBS reports an error.</p>
|
|
<p class="msonormal" id="obs_04_0080__p64200303">You can also specify the value of the <strong id="obs_04_0080__b1461685225154325">x-obs-acl</strong> parameter to configure an access control policy for the object. If the <strong id="obs_04_0080__b8947184165818">x-obs-acl</strong> parameter is not specified when an anonymous user uploads an object, the object can be accessed by all OBS users by default.</p>
|
|
<p class="msonormal" id="obs_04_0080__p40931822">This operation supports server-side encryption.</p>
|
|
<p id="obs_04_0080__p1017591824310">For a single upload, the size of the object to be uploaded ranges [0, 5 GB]. To upload a file greater than 5 GB, see <a href="obs_04_0096.html">Operations on Multipart Upload</a>.</p>
|
|
<p id="obs_04_0080__p1130673486">OBS does not have real folders. To facilitate data management, OBS provides a method to simulate a folder by adding a slash (/) to the object name, for example, <strong id="obs_04_0080__b16916144518106">test/123.jpg</strong>. You can simulate <strong id="obs_04_0080__b1183114613107">test</strong> as a folder and <strong id="obs_04_0080__b183314461104">123.jpg</strong> as the name of a file under the <strong id="obs_04_0080__b19834154641019">test</strong> folder. However, the object key remains <strong id="obs_04_0080__b148351346101015">test/123.jpg</strong>. Objects named in this format appear as folders on the console. When you upload an object larger than 0 in size using this format, an empty folder will be displayed on the console, but the occupied storage capacity is the actual object size.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0080__section9125142514612"><h4 class="sectiontitle">Differences Between PUT and POST Methods</h4><p id="obs_04_0080__p154258324469">Parameters are passed through the request header if the PUT method is used to upload objects; if the POST method is used to upload objects, parameters are passed through the form field in the message body.</p>
|
|
<p id="obs_04_0080__p92971585546">With the PUT method, you need to specify the object name in the URL, but object name is not required with the POST method, which uses the bucket domain name as the URL. Request lines of these two methods are given as follows:</p>
|
|
<pre class="screen" id="obs_04_0080__screen53331759111919">PUT /ObjectName HTTP/1.1</pre>
|
|
<pre class="screen" id="obs_04_0080__screen666703202019">POST / HTTP/1.1</pre>
|
|
<p id="obs_04_0080__p62431152115613">For details about POST upload, see <a href="obs_04_0081.html">Uploading an Object - POST</a>.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0080__section27143284"><h4 class="sectiontitle">Versioning</h4><p class="msonormal" id="obs_04_0080__p31746393">If versioning is enabled for a bucket, the system automatically generates a unique version ID for the requested object in this bucket and returns the version ID in response header <strong id="obs_04_0080__b38890115">x-obs-version-id</strong>. If versioning is suspended for the bucket, the object version ID is <strong id="obs_04_0080__b4762183545911">null</strong>. For details about the versioning statuses of a bucket, see <a href="obs_04_0037.html">Configuring Versioning for a Bucket</a>.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0080__section1475721115541"><h4 class="sectiontitle">WORM</h4><p id="obs_04_0080__p759131755418">If a bucket has WORM enabled, you can configure retention policies for objects in the bucket. You can specify the <strong id="obs_04_0080__b1821612513390">x-obs-object-lock-mode</strong> and <strong id="obs_04_0080__b378111773910">x-obs-object-lock-retain-until-date</strong> headers to configure a retention policy when you upload an object. 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 uploaded. You can also configure or update a WORM retention policy for an existing object.</p>
|
|
<div class="note" id="obs_04_0080__note143221114511"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="obs_04_0080__p1277512964714">When you enable WORM for a bucket, OBS automatically enables versioning for the bucket. WORM protects objects based on the object version IDs. Only object versions with any WORM retention policy configured will be protected. Assume that object <strong id="obs_04_0080__b86122918189">test.txt 001</strong> is protected by WORM. If another file with the same name is uploaded, a new object version <strong id="obs_04_0080__b1110331181915">test.txt 002</strong> with no WORM policy configured will be generated. In such case, <strong id="obs_04_0080__b5285134217204">test.txt 002</strong> is not protected and can be deleted. When you download an object without specifying a version ID, the current object version (<strong id="obs_04_0080__b863463619217">test.txt 002</strong>) will be downloaded.</p>
|
|
</div></div>
|
|
</div>
|
|
<div class="section" id="obs_04_0080__section42962965"><h4 class="sectiontitle">Request Syntax</h4><div class="codecoloring" codetype="Xml" id="obs_04_0080__screen49284209"><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></pre></div></td><td class="code"><div><pre><span></span>PUT<span class="w"> </span>/ObjectName<span class="w"> </span>HTTP/1.1<span class="w"> </span>
|
|
Host:<span class="w"> </span>bucketname.obs.region.example.com
|
|
Content-Type:<span class="w"> </span>application/xml<span class="w"> </span>
|
|
Content-Length:<span class="w"> </span>length
|
|
Authorization:<span class="w"> </span>authorization
|
|
Date:<span class="w"> </span>date
|
|
<span class="nt"><Optional</span><span class="w"> </span><span class="err">Additional</span><span class="w"> </span><span class="err">Header</span><span class="nt">></span><span class="w"> </span>
|
|
<span class="nt"><object</span><span class="w"> </span><span class="err">Content</span><span class="nt">></span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0080__section51122366"><h4 class="sectiontitle">Request Parameters</h4><p class="msonormal" id="obs_04_0080__p42790668">This request contains no parameters.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0080__section57448112"><h4 class="sectiontitle">Request Headers</h4><p class="msonormal" id="obs_04_0080__p43492103">This request uses common headers. For details, see <a href="obs_04_0007.html#obs_04_0007__table25197309">Table 3</a>. The request can use additional headers, as listed in <a href="#obs_04_0080__table21799862">Table 1</a>.</p>
|
|
<div class="note" id="obs_04_0080__note4512153213375"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="obs_04_0080__p051243219372">OBS supports the six HTTP request headers: Cache-Control, Expires, Content-Encoding, Content-Disposition, Content-Type, and Content-Language. If these headers are carried in an object upload request, their values are saved. You can also call the metadata modification API, provided by OBS, to change the values of the six headers. When the object is downloaded or queried, the saved values are set for corresponding HTTP headers and returned to the client.</p>
|
|
</div></div>
|
|
|
|
<div class="tablenoborder"><a name="obs_04_0080__table21799862"></a><a name="table21799862"></a><table cellpadding="4" cellspacing="0" summary="" id="obs_04_0080__table21799862" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Request headers</caption><thead align="left"><tr id="obs_04_0080__row34347226"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.7.4.2.4.1.1"><p id="obs_04_0080__p30661915">Header</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="66%" id="mcps1.3.7.4.2.4.1.2"><p id="obs_04_0080__p5284369">Description</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="9%" id="mcps1.3.7.4.2.4.1.3"><p id="obs_04_0080__p27100472">Mandatory</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="obs_04_0080__row26238096"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.7.4.2.4.1.1 "><p id="obs_04_0080__p44911008">Content-MD5</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.7.4.2.4.1.2 "><p id="obs_04_0080__p13913041">Base64-encoded 128-bit MD5 digest of the message according to RFC 1864.</p>
|
|
<p id="obs_04_0080__p58108509">Type: string</p>
|
|
<p id="obs_04_0080__p53214538">Example: <strong id="obs_04_0080__b1720503944514">n58IG6hfM7vqI4K0vnWpog==</strong></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="9%" headers="mcps1.3.7.4.2.4.1.3 "><p id="obs_04_0080__p15410356">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0080__row4475483"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.7.4.2.4.1.1 "><p id="obs_04_0080__p26969841">x-obs-acl</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.7.4.2.4.1.2 "><p id="obs_04_0080__p3956172453110">This header can be added to set access control policies for objects when creating the objects. The access control policies are the predefined common policies, including <strong id="obs_04_0080__b842352706163347">private</strong>, <strong id="obs_04_0080__b842352706163352">public-read</strong>, <strong id="obs_04_0080__b842352706163357">public-read-write</strong>.</p>
|
|
<p id="obs_04_0080__p50162129">Type: string</p>
|
|
<p id="obs_04_0080__p48805985">Note: This header is a predefined policy expressed in a character string.</p>
|
|
<p id="obs_04_0080__p331411337426">Example: <strong id="obs_04_0080__b993334884514">x-obs-acl: public-read</strong></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="9%" headers="mcps1.3.7.4.2.4.1.3 "><p id="obs_04_0080__p60970709">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0080__row176201754161817"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.7.4.2.4.1.1 "><p id="obs_04_0080__p54102201376">x-obs-grant-read</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.7.4.2.4.1.2 "><p id="obs_04_0080__p1041152010375">When creating an object, 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_0080__p036992924111">Type: string</p>
|
|
<p id="obs_04_0080__p1245415214403">Example: <strong id="obs_04_0080__b12371913312">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%" headers="mcps1.3.7.4.2.4.1.3 "><p id="obs_04_0080__p341182017372">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0080__row1852810319198"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.7.4.2.4.1.1 "><p id="obs_04_0080__p2784192993712">x-obs-grant-read-acp</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.7.4.2.4.1.2 "><p id="obs_04_0080__p6913194219811">When creating an object, you can use this header to grant all users in an account the permissions to obtain the object ACL.</p>
|
|
<p id="obs_04_0080__p49151332194119">Type: string</p>
|
|
<p id="obs_04_0080__p19223133034117">Example: <strong id="obs_04_0080__b3858353414">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%" headers="mcps1.3.7.4.2.4.1.3 "><p id="obs_04_0080__p9785429153711">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0080__row1337219031911"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.7.4.2.4.1.1 "><p id="obs_04_0080__p4151526163710">x-obs-grant-write-acp</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.7.4.2.4.1.2 "><p id="obs_04_0080__p94031856283">When creating an object, you can use this header to grant all users in an account the permission to write the object ACL.</p>
|
|
<p id="obs_04_0080__p79212366417">Type: string</p>
|
|
<p id="obs_04_0080__p95921443104120">Example: <strong id="obs_04_0080__b1094520314417">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%" headers="mcps1.3.7.4.2.4.1.3 "><p id="obs_04_0080__p1316182618370">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0080__row10662185731812"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.7.4.2.4.1.1 "><p id="obs_04_0080__p3389132314376">x-obs-grant-full-control</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.7.4.2.4.1.2 "><p id="obs_04_0080__p1914315101898">When creating an object, 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_0080__p1284513399419">Type: string</p>
|
|
<p id="obs_04_0080__p428421618431">Example: <strong id="obs_04_0080__b139941255948">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%" headers="mcps1.3.7.4.2.4.1.3 "><p id="obs_04_0080__p12389102314371">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0080__row11865476"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.7.4.2.4.1.1 "><p id="obs_04_0080__p21579520">x-obs-storage-class</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.7.4.2.4.1.2 "><p id="obs_04_0080__p3110729">When creating an object, you can use 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_0080__p27996566">Type: string</p>
|
|
<p id="obs_04_0080__p14339210104117">Storage class options: <strong id="obs_04_0080__b7978125265316">STANDARD</strong> (Standard), <strong id="obs_04_0080__b09791552155319">WARM</strong> (Warm), <strong id="obs_04_0080__b18979115235317">COLD</strong> (Cold). These values are case sensitive.</p>
|
|
<p id="obs_04_0080__p53129340">Example: <strong id="obs_04_0080__b1115816794616">x-obs-storage-class: STANDARD</strong></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="9%" headers="mcps1.3.7.4.2.4.1.3 "><p id="obs_04_0080__p8509283">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0080__row9474686"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.7.4.2.4.1.1 "><p id="obs_04_0080__p29252105">x-obs-meta-*</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.7.4.2.4.1.2 "><p id="obs_04_0080__p20610280">When creating an object, you can use a header starting with <strong id="obs_04_0080__b14342076819330">x-obs-meta-</strong> to define object metadata in an HTTP request. 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_0080__p51274795">Type: string</p>
|
|
<p id="obs_04_0080__p58819972">Example: <strong id="obs_04_0080__b540181244618">x-obs-meta-test: test metadata</strong></p>
|
|
<p id="obs_04_0080__p172151945102012">Constraint: Both user-defined metadata keys and their values must conform to US-ASCII standards.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="9%" headers="mcps1.3.7.4.2.4.1.3 "><p id="obs_04_0080__p66797252">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0080__row64304357"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.7.4.2.4.1.1 "><p id="obs_04_0080__p41270423">x-obs-website-redirect-location</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.7.4.2.4.1.2 "><p id="obs_04_0080__p54569953">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_0080__p21367535">In the following example, the request header sets the redirection to an object (<strong id="obs_04_0080__b1723225149">anotherPage.html</strong>) in the same bucket:</p>
|
|
<p id="obs_04_0080__p58090092">x-obs-website-redirect-location:/anotherPage.html</p>
|
|
<p id="obs_04_0080__p53048785">In the following example, the request header sets the object redirection to an external URL:</p>
|
|
<p id="obs_04_0080__p7677024">x-obs-website-redirect-location:http://www.example.com/</p>
|
|
<p id="obs_04_0080__p1984352">Type: string</p>
|
|
<p id="obs_04_0080__p17859171">Default value: none</p>
|
|
<p id="obs_04_0080__p26514819">Constraint: The value must be prefixed by a slash (/), <strong id="obs_04_0080__b456419220472">http://</strong>, or <strong id="obs_04_0080__b165661028471">https://</strong>. The length of the value cannot exceed 2 KB.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="9%" headers="mcps1.3.7.4.2.4.1.3 "><p id="obs_04_0080__p216739">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0080__row1950653"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.7.4.2.4.1.1 "><p id="obs_04_0080__p23785186">x-obs-server-side-encryption</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.7.4.2.4.1.2 "><p id="obs_04_0080__p47551928">Indicates that SSE-KMS is used. </p>
|
|
<p id="obs_04_0080__p25314173">Type: string</p>
|
|
<p id="obs_04_0080__p26500966">Example: <strong id="obs_04_0080__b480014200462">x-obs-server-side-encryption: kms</strong></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="9%" headers="mcps1.3.7.4.2.4.1.3 "><p id="obs_04_0080__p66203541">No. This header is required when SSE-KMS is used.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0080__row58960965"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.7.4.2.4.1.1 "><p id="obs_04_0080__p11108823">x-obs-server-side-encryption-kms-key-id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.7.4.2.4.1.2 "><p id="obs_04_0080__p16779515135616"><strong id="obs_04_0080__b1637810181284">Explanation</strong>:</p>
|
|
<p id="obs_04_0080__p127799156563">The key used to encrypt objects. This header can be specified using either of the following formats:</p>
|
|
<p id="obs_04_0080__p147792155569">1. <em id="obs_04_0080__i1748822832815">regionID</em><strong id="obs_04_0080__b12649193519283">:</strong><em id="obs_04_0080__i2090653032810">domainID</em><strong id="obs_04_0080__b990342132817">:</strong><strong id="obs_04_0080__b0359181182918">key/</strong><em id="obs_04_0080__i138321036296">key_id</em>: <em id="obs_04_0080__i12471313142811">regionID</em> indicates the ID of the region where the key belongs. <em id="obs_04_0080__i9247413152820">domainID</em> indicates the ID of the tenant where the key belongs. <em id="obs_04_0080__i1924712133289">key_id</em> indicates the ID of the key created in KMS on the DEW console. An example is given as follows: <strong id="obs_04_0080__b759430194720">x-obs-server-side-encryption-kms-key-id: </strong><em id="obs_04_0080__i0937163785812">region</em><strong id="obs_04_0080__b5879431203618">:exampledomainid: key/4f1cd4de-ab64-4807-920a-47fc42e7f0d0</strong>.</p>
|
|
<p id="obs_04_0080__p6779415115615">2. <em id="obs_04_0080__i1367948133617">key_id</em>: It indicates the ID of the key created in KMS on the DEW console. An example is given as follows: <strong id="obs_04_0080__b5587387393">x-obs-server-side-encryption-kms-key-id: 4f1cd4de-ab64-4807-920a-47fc42e7f0d0</strong>.</p>
|
|
<p id="obs_04_0080__p97793154567"><strong id="obs_04_0080__b1392517101611">Restrictions</strong>:</p>
|
|
<p id="obs_04_0080__p8779121513566">This header can be used only when you set the <strong id="obs_04_0080__b8427938104010">x-obs-server-side-encryption</strong> header to <strong id="obs_04_0080__b10482017414">kms</strong>.</p>
|
|
<p id="obs_04_0080__p16779015195615"><strong id="obs_04_0080__b122221815179">Default value</strong>:</p>
|
|
<p id="obs_04_0080__p577951515617">If you choose the KMS encryption but do not specify this header, the default master key will be used. If there is no such a default master key, OBS will create one and use it by default.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="9%" headers="mcps1.3.7.4.2.4.1.3 "><p id="obs_04_0080__p50495402">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0080__row51805439"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.7.4.2.4.1.1 "><p id="obs_04_0080__p35491065">x-obs-server-side-encryption-customer-algorithm</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.7.4.2.4.1.2 "><p id="obs_04_0080__p56204044">Indicates the encryption algorithm when SSE-C is used.</p>
|
|
<p id="obs_04_0080__p36074350">Type: string</p>
|
|
<p id="obs_04_0080__p56233695">Example: <strong id="obs_04_0080__b0697153916464">x-obs-server-side-encryption-customer-algorithm: AES256</strong></p>
|
|
<p id="obs_04_0080__p36341208">Constraint: This header must be used together with <strong id="obs_04_0080__b11583133231714">x-obs-server-side-encryption-customer-key</strong> and <strong id="obs_04_0080__b154311480174">x-obs-server-side-encryption-customer-key-MD5</strong>.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="9%" headers="mcps1.3.7.4.2.4.1.3 "><p id="obs_04_0080__p57956718">No. This header is required when SSE-C is used.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0080__row51848422"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.7.4.2.4.1.1 "><p id="obs_04_0080__p38972650">x-obs-server-side-encryption-customer-key</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.7.4.2.4.1.2 "><p id="obs_04_0080__p2668111">Indicates the key for encrypting objects when SSE-C is used.</p>
|
|
<p id="obs_04_0080__p24013005">Type: string</p>
|
|
<p id="obs_04_0080__p14790461">Example: <strong id="obs_04_0080__b15597134479">x-obs-server-side-encryption-customer-key:K7QkYpBkM5+hca27fsNkUnNVaobncnLht/rCB2o/9Cw=</strong></p>
|
|
<p id="obs_04_0080__p66005286">Constraint: This header is a Base64-encoded 256-bit key and must be used together with <strong id="obs_04_0080__b5178479">x-obs-server-side-encryption-customer-algorithm</strong> and <strong id="obs_04_0080__b46606312">x-obs-server-side-encryption-customer-key-MD5</strong>.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="9%" headers="mcps1.3.7.4.2.4.1.3 "><p id="obs_04_0080__p44827955">No. This header is required when SSE-C is used.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0080__row798417"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.7.4.2.4.1.1 "><p id="obs_04_0080__p64671816">x-obs-server-side-encryption-customer-key-MD5</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.7.4.2.4.1.2 "><p id="obs_04_0080__p3925735">Indicates the MD5 value of the encryption key when SSE-C is used. The MD5 value is used to check whether any error occurs during the transmission of the key. </p>
|
|
<p id="obs_04_0080__p35331622">Type: string</p>
|
|
<p id="obs_04_0080__p49549143">Example: <strong id="obs_04_0080__b1951419189471">x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==</strong></p>
|
|
<p id="obs_04_0080__p43289109">Constraint: This header is a Base64-encoded 128-bit MD5 value and must be used together with <strong id="obs_04_0080__b1830803952110">x-obs-server-side-encryption-customer-algorithm</strong> and <strong id="obs_04_0080__b18869185016212">x-obs-server-side-encryption-customer-key</strong>.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="9%" headers="mcps1.3.7.4.2.4.1.3 "><p id="obs_04_0080__p16756929">No. This header is required when SSE-C is used.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0080__row849053217272"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.7.4.2.4.1.1 "><p id="obs_04_0080__p16490173217273">success-action-redirect</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.7.4.2.4.1.2 "><p id="obs_04_0080__p28747278">Indicates the address (URL) to which a successfully responded request is redirected.</p>
|
|
<ul id="obs_04_0080__ul57398910"><li id="obs_04_0080__li46828145">If the value is valid and the request is successful, OBS returns status code 303. <strong id="obs_04_0080__b50725990">Location</strong> contains <strong id="obs_04_0080__b8423527069138">success_action_redirect</strong> as well as the bucket name, object name, and object ETag.</li><li id="obs_04_0080__li18800129">If this parameter value is invalid, OBS ignores this parameter. In such case, the <strong id="obs_04_0080__b170793813459">Location</strong> header is the object address, and OBS returns the response code based on whether the operation succeeds or fails.</li></ul>
|
|
<p id="obs_04_0080__p34983438">Type: string</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="9%" headers="mcps1.3.7.4.2.4.1.3 "><p id="obs_04_0080__p134912032112711">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0080__row121411077571"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.7.4.2.4.1.1 "><p id="obs_04_0080__p1514215711573">x-obs-expires</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.7.4.2.4.1.2 "><p id="obs_04_0080__p038312375711">Specifies when an object expires. It is measured in days. Once the object expires, it is automatically deleted. (The validity calculates from the object's creation time.)</p>
|
|
<p id="obs_04_0080__p72445358436">You can configure this field when uploading an object or modify this field by using the metadata modification API after the object is uploaded.</p>
|
|
<p id="obs_04_0080__p133831235577">Type: integer</p>
|
|
<p id="obs_04_0080__p638302312574">Example: <strong id="obs_04_0080__b168957229472">x-obs-expires:3</strong></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="9%" headers="mcps1.3.7.4.2.4.1.3 "><p id="obs_04_0080__p1014357105719">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0080__row1618015184185"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.7.4.2.4.1.1 "><p id="obs_04_0080__p5180191819182"><span style="color:#494949;">x-obs-object-lock-mode</span></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.7.4.2.4.1.2 "><p id="obs_04_0080__p6180918151813">WORM mode that will be applied to the object. Currently, only <strong id="obs_04_0080__b3645183481914">COMPLIANCE</strong> is supported. This header must be used together with <strong id="obs_04_0080__b20678132292017">x-obs-object-lock-retain-until-date</strong>.</p>
|
|
<p id="obs_04_0080__p14496145181918">Type: string</p>
|
|
<p id="obs_04_0080__p154228537191">Example: <strong id="obs_04_0080__b1534613339474">x-obs-object-lock-mode:COMPLIANCE</strong></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="9%" headers="mcps1.3.7.4.2.4.1.3 "><p id="obs_04_0080__p2180181810184">No, but required when <strong id="obs_04_0080__b17286940194118">x-obs-object-lock-retain-until-date</strong> is present.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0080__row28092205182"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.7.4.2.4.1.1 "><p id="obs_04_0080__p14809920131812"><span style="color:#494949;">x-obs-object-lock-retain-until-date</span></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.7.4.2.4.1.2 "><p id="obs_04_0080__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_0080__b814182742914">2015-07-01T04:11:15Z</strong>. This header must be used together with <strong id="obs_04_0080__b01410270294">x-obs-object-lock-mode</strong>.</p>
|
|
<p id="obs_04_0080__p1972081822113">Type: string</p>
|
|
<p id="obs_04_0080__p372031872119">Example: <strong id="obs_04_0080__b2393113813470">x-obs-object-lock-retain-until-date:2015-07-01T04:11:15Z</strong></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="9%" headers="mcps1.3.7.4.2.4.1.3 "><p id="obs_04_0080__p080992031813">No, but required when <strong id="obs_04_0080__b15381950192919">x-obs-object-lock-mode</strong> is present.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0080__section47270964"><h4 class="sectiontitle">Request Elements</h4><p class="msonormal" id="obs_04_0080__p15133969">This request contains no elements. Its body contains only the content of the requested object.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0080__section22785500"><h4 class="sectiontitle">Response Syntax</h4><div class="codecoloring" codetype="Xml" id="obs_04_0080__screen17891949"><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></pre></div></td><td class="code"><div><pre><span></span>HTTP/1.1<span class="w"> </span>status_code
|
|
Content-Length:<span class="w"> </span>length
|
|
Content-Type:<span class="w"> </span>type
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0080__section3742912"><h4 class="sectiontitle">Response Headers</h4><p class="msonormal" id="obs_04_0080__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>
|
|
<p class="msonormal" id="obs_04_0080__p30613480">In addition to the common response headers, the headers listed in <a href="#obs_04_0080__table24122936102344">Table 2</a> may be used.</p>
|
|
|
|
<div class="tablenoborder"><a name="obs_04_0080__table24122936102344"></a><a name="table24122936102344"></a><table cellpadding="4" cellspacing="0" summary="" id="obs_04_0080__table24122936102344" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Additional response headers</caption><thead align="left"><tr id="obs_04_0080__row36471658"><th align="left" class="cellrowborder" valign="top" width="40.400000000000006%" id="mcps1.3.10.4.2.3.1.1"><p id="obs_04_0080__p1414299">Header</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="59.599999999999994%" id="mcps1.3.10.4.2.3.1.2"><p id="obs_04_0080__p47449426">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="obs_04_0080__row18198260"><td class="cellrowborder" valign="top" width="40.400000000000006%" headers="mcps1.3.10.4.2.3.1.1 "><p id="obs_04_0080__p64772971">x-obs-version-id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.599999999999994%" headers="mcps1.3.10.4.2.3.1.2 "><p id="obs_04_0080__p12119327">Object version ID. If versioning is enabled for the bucket, the object version ID will be returned.</p>
|
|
<p id="obs_04_0080__p41965083">Type: string</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0080__row42141431"><td class="cellrowborder" valign="top" width="40.400000000000006%" headers="mcps1.3.10.4.2.3.1.1 "><p id="obs_04_0080__p58012764">x-obs-server-side-encryption</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.599999999999994%" headers="mcps1.3.10.4.2.3.1.2 "><p id="obs_04_0080__p1413429">This header is included in a response if SSE-KMS is used. </p>
|
|
<p id="obs_04_0080__p12720865">Type: string</p>
|
|
<p id="obs_04_0080__p47378923">Example: <strong id="obs_04_0080__b20285045184714">x-obs-server-side-encryption:kms</strong></p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0080__row23757124"><td class="cellrowborder" valign="top" width="40.400000000000006%" headers="mcps1.3.10.4.2.3.1.1 "><p id="obs_04_0080__p45278863">x-obs-server-side-encryption-kms-key-id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.599999999999994%" headers="mcps1.3.10.4.2.3.1.2 "><p id="obs_04_0080__p43709291">Indicates the master key ID. This header is included in a response when SSE-KMS is used. </p>
|
|
<p id="obs_04_0080__p119654525336">Type: string</p>
|
|
<p id="obs_04_0080__p9548134263614">Format: <em id="obs_04_0080__i7268621365">regionID</em><strong id="obs_04_0080__b172741626617">:</strong><em id="obs_04_0080__i82747217614">domainID</em><strong id="obs_04_0080__b132751321764">:key/</strong><em id="obs_04_0080__i192752022610">key_id</em></p>
|
|
<p id="obs_04_0080__p1399473215337"><em id="obs_04_0080__i10127115115713">regionID</em> indicates the ID of the region where the key belongs. <em id="obs_04_0080__i1119611917578">domainID</em> indicates the ID of the tenant where the key belongs. <em id="obs_04_0080__i98931215155718">key_id</em> indicates the key ID used in this encryption.</p>
|
|
<p id="obs_04_0080__p191815724215">Example: <strong id="obs_04_0080__b32942331311">x-obs-server-side-encryption-kms-key-id:</strong><em id="obs_04_0080__i166738213374">region</em><strong id="obs_04_0080__b4440162791319">:domainiddomainiddomainiddoma0001:key/4f1cd4de-ab64-4807-920a-47fc42e7f0d0</strong></p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0080__row50791679"><td class="cellrowborder" valign="top" width="40.400000000000006%" headers="mcps1.3.10.4.2.3.1.1 "><p id="obs_04_0080__p20485364">x-obs-server-side-encryption-customer-algorithm</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.599999999999994%" headers="mcps1.3.10.4.2.3.1.2 "><p id="obs_04_0080__p48701810">Indicates the encryption algorithm. This header is included in a response when SSE-C is used.</p>
|
|
<p id="obs_04_0080__p35663107">Type: string</p>
|
|
<p id="obs_04_0080__p52532512">Example: <strong id="obs_04_0080__b1352914544812">x-obs-server-side-encryption-customer-algorithm: AES256</strong></p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0080__row3030560"><td class="cellrowborder" valign="top" width="40.400000000000006%" headers="mcps1.3.10.4.2.3.1.1 "><p id="obs_04_0080__p44148826">x-obs-server-side-encryption-customer-key-MD5</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.599999999999994%" headers="mcps1.3.10.4.2.3.1.2 "><p id="obs_04_0080__p19285144">Indicates the MD5 value of the key for encrypting objects. This header is included in a response when SSE-C is used.</p>
|
|
<p id="obs_04_0080__p39348572">Type: string</p>
|
|
<p id="obs_04_0080__p18592835">Example: <strong id="obs_04_0080__b198645132483">x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==</strong></p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0080__row33117788"><td class="cellrowborder" valign="top" width="40.400000000000006%" headers="mcps1.3.10.4.2.3.1.1 "><p id="obs_04_0080__p65295189">x-obs-storage-class</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.599999999999994%" headers="mcps1.3.10.4.2.3.1.2 "><p id="obs_04_0080__p54418926">This header is returned when the storage class of an object is not Standard. The value can be <strong id="obs_04_0080__b371322482811">WARM</strong> or <strong id="obs_04_0080__b137131424112816">COLD</strong>.</p>
|
|
<p id="obs_04_0080__p20008286">Type: string</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0080__section33686208"><h4 class="sectiontitle">Response Elements</h4><p class="msonormal" id="obs_04_0080__p10058442">This response contains no elements.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0080__section34740423"><h4 class="sectiontitle">Error Responses</h4><p class="msonormal" id="obs_04_0080__p9427499">No special error responses are returned. For details about error responses, see <a href="obs_04_0115.html#obs_04_0115__d0e843">Table 2</a>.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0080__section14482163815396"><h4 class="sectiontitle">Sample Request: Uploading an Object</h4><div class="codecoloring" codetype="Xml" id="obs_04_0080__screen8484163863919"><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></pre></div></td><td class="code"><div><pre><span></span>PUT<span class="w"> </span>/object01<span class="w"> </span>HTTP/1.1
|
|
User-Agent:<span class="w"> </span>curl/7.29.0
|
|
Host:<span class="w"> </span>examplebucket.obs.region.example.com
|
|
Accept:<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>04:11:15<span class="w"> </span>GMT
|
|
Authorization:<span class="w"> </span>OBS<span class="w"> </span>H4IPJX0TQTHTHEBQQCEC:gYqplLq30dEX7GMi2qFWyjdFsyw=
|
|
Content-Length:<span class="w"> </span>10240
|
|
Expect:<span class="w"> </span>100-continue
|
|
|
|
[1024<span class="w"> </span>Byte<span class="w"> </span>data<span class="w"> </span>content]
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0080__section11653102613112"><h4 class="sectiontitle">Sample Response: Uploading an Object</h4><div class="codecoloring" codetype="Xml" id="obs_04_0080__screen37481040121111"><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>BF2600000164364C10805D385E1E3C67
|
|
ETag:<span class="w"> </span>"d41d8cd98f00b204e9800998ecf8427e"
|
|
x-obs-id-2:<span class="w"> </span>32AAAWJAMAABAAAQAAEAABAAAQAAEAABCTzu4Jp2lquWuXsjnLyPPiT3cfGhqPoY
|
|
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>04:11:15<span class="w"> </span>GMT
|
|
Content-Length:<span class="w"> </span>0
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0080__section9978114711117"><h4 class="sectiontitle">Sample Request: Uploading an Object (with the ACL Configured)</h4><div class="codecoloring" codetype="Xml" id="obs_04_0080__screen377183710355"><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>PUT<span class="w"> </span>/object01<span class="w"> </span>HTTP/1.1
|
|
User-Agent:<span class="w"> </span>curl/7.29.0
|
|
Host:<span class="w"> </span>examplebucket.obs.region.example.com
|
|
Accept:<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>04:13:55<span class="w"> </span>GMT
|
|
x-obs-grant-read:id=52f24s3593as5730ea4f722483579ai7,id=a93fcas852f24s3596ea8366794f7224
|
|
Authorization:<span class="w"> </span>OBS<span class="w"> </span>H4IPJX0TQTHTHEBQQCEC:gYqplLq30dEX7GMi2qFWyjdFsyw=
|
|
Content-Length:<span class="w"> </span>10240
|
|
Expect:<span class="w"> </span>100-continue
|
|
|
|
[1024<span class="w"> </span>Byte<span class="w"> </span>data<span class="w"> </span>content]
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0080__section17245101261216"><h4 class="sectiontitle">Sample Response: Uploading an Object (with the ACL Configured)</h4><div class="codecoloring" codetype="Xml" id="obs_04_0080__screen8485113814"><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>BB7800000164845759E4F3B39ABEE55E
|
|
ETag:<span class="w"> </span>"d41d8cd98f00b204e9800998ecf8427e"
|
|
x-obs-id-2:<span class="w"> </span>32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSReVRNuas0knI+Y96iXrZA7BLUgj06Z
|
|
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>04:13:55<span class="w"> </span>GMT
|
|
Content-Length:<span class="w"> </span>0
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0080__section18923277137"><h4 class="sectiontitle">Sample Request: Uploading an Object to a Versioned Bucket</h4><div class="codecoloring" codetype="Xml" id="obs_04_0080__screen476312144396"><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>PUT<span class="w"> </span>/object01<span class="w"> </span>HTTP/1.1
|
|
User-Agent:<span class="w"> </span>curl/7.29.0
|
|
Host:<span class="w"> </span>examplebucket.obs.region.example.com
|
|
Accept:<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>04:17:12<span class="w"> </span>GMT
|
|
x-obs-storage-class:<span class="w"> </span>WARM
|
|
Authorization:<span class="w"> </span>OBS<span class="w"> </span>H4IPJX0TQTHTHEBQQCEC:uFVJhp/dJqj/CJIVLrSZ0gpw3ng=
|
|
Content-Length:<span class="w"> </span>10240
|
|
Expect:<span class="w"> </span>100-continue
|
|
|
|
[1024<span class="w"> </span>Byte<span class="w"> </span>data<span class="w"> </span>content]
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0080__section16530173215133"><h4 class="sectiontitle">Sample Response: Uploading an Object to a Versioned Bucket</h4><div class="codecoloring" codetype="Xml" id="obs_04_0080__screen6331341111313"><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></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>DCD2FC9CAB78000001439A51DB2B2577
|
|
ETag:<span class="w"> </span>"d41d8cd98f00b204e9800998ecf8427e"
|
|
X-OBS-ID-2:<span class="w"> </span>GcVgfeOJHx8JZHTHrRqkPsbKdB583fYbr3RBbHT6mMrBstReVILBZbMAdLiBYy1l
|
|
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>04:17:12<span class="w"> </span>GMT
|
|
x-obs-version-id:<span class="w"> </span>AAABQ4q2M9_c0vycq3gAAAAAVURTRkha
|
|
Content-Length:<span class="w"> </span>0
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0080__section17724204519133"><h4 class="sectiontitle">Sample Request: Uploading an Object (with Its MD5 Specified)</h4><div class="codecoloring" codetype="Xml" id="obs_04_0080__screen5405153113413"><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>PUT<span class="w"> </span>/object01<span class="w"> </span>HTTP/1.1
|
|
User-Agent:<span class="w"> </span>curl/7.29.0
|
|
Host:<span class="w"> </span>examplebucket.obs.region.example.com
|
|
Accept:<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>04:17:50<span class="w"> </span>GMT
|
|
Authorization:<span class="w"> </span>OBS<span class="w"> </span>H4IPJX0TQTHTHEBQQCEC:uFVJhp/dJqj/CJIVLrSZ0gpw3ng=
|
|
Content-Length:<span class="w"> </span>10
|
|
Content-MD5:<span class="w"> </span>6Afx/PgtEy+bsBjKZzihnw==
|
|
Expect:<span class="w"> </span>100-continue
|
|
|
|
1234567890
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0080__section3283216161415"><h4 class="sectiontitle">Sample Response: Uploading an Object (with Its MD5 Specified)</h4><div class="codecoloring" codetype="Xml" id="obs_04_0080__screen16848152591416"><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>BB7800000164B165971F91D82217D105
|
|
X-OBS-ID-2:<span class="w"> </span>32AAAUJAIAABAAAQAAEAABAAAQAAEAABCSEKhBpS4BB3dSMNqMtuNxQDD9XvOw5h
|
|
ETag:<span class="w"> </span>"1072e1b96b47d7ec859710068aa70d57"
|
|
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>04:17:50<span class="w"> </span>GMT
|
|
Content-Length:<span class="w"> </span>0
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0080__section2272113211413"><h4 class="sectiontitle">Sample Request: Uploading an Object (with Website Hosting Configured)</h4><p id="obs_04_0080__p92041612152516"><strong id="obs_04_0080__b34252952419">If static website hosting has been configured for a bucket, you can configure parameters as follows when you upload an object. Then, users will be redirected when they download the object.</strong></p>
|
|
<div class="codecoloring" codetype="Xml" id="obs_04_0080__screen961842162414"><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>PUT<span class="w"> </span>/object01<span class="w"> </span>HTTP/1.1
|
|
User-Agent:<span class="w"> </span>curl/7.29.0
|
|
Host:<span class="w"> </span>examplebucket.obs.region.example.com
|
|
Accept:<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>04:17:12<span class="w"> </span>GMT
|
|
x-obs-website-redirect-location:<span class="w"> </span>http://www.example.com/
|
|
Authorization:<span class="w"> </span>OBS<span class="w"> </span>H4IPJX0TQTHTHEBQQCEC:uFVJhp/dJqj/CJIVLrSZ0gpw3ng=
|
|
Content-Length:<span class="w"> </span>10240
|
|
Expect:<span class="w"> </span>100-continue
|
|
|
|
[1024<span class="w"> </span>Byte<span class="w"> </span>data<span class="w"> </span>content]
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0080__section632052520159"><h4 class="sectiontitle">Sample Response: Uploading an Object (with Website Hosting Configured)</h4><div class="codecoloring" codetype="Xml" id="obs_04_0080__screen63684222415"><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></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>DCD2FC9CAB78000001439A51DB2B2577
|
|
x-obs-id-2:<span class="w"> </span>32AAAUJAIAABAAAQAAEAABAAAQAAEAABCTmxB5ufMj/7/GzP8TFwTbp33u0xhn2Z
|
|
ETag:<span class="w"> </span>"1072e1b96b47d7ec859710068aa70d57"
|
|
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>04:17:12<span class="w"> </span>GMT
|
|
x-obs-version-id:<span class="w"> </span>AAABQ4q2M9_c0vycq3gAAAAAVURTRkha
|
|
Content-Length:<span class="w"> </span>0
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0080__section9838237181513"><h4 class="sectiontitle">Sample Request: Uploading an Object Using a Signed URL</h4><pre class="screen" id="obs_04_0080__screen18133558153">PUT /object02?AccessKeyId=H4IPJX0TQTHTHEBQQCEC&Expires=1532688887&Signature=EQmDuOhaLUrzrzRNZxwS72CXeXM%3D HTTP/1.1
|
|
User-Agent: curl/7.29.0
|
|
Host: examplebucket.obs.<em id="obs_04_0080__i1766314309266">region</em>.example.com
|
|
Accept: */*
|
|
Content-Length: 1024
|
|
|
|
<em id="obs_04_0080__i28288554154">[1024 Byte data content]</em></pre>
|
|
</div>
|
|
<div class="section" id="obs_04_0080__section96529021618"><h4 class="sectiontitle">Sample Response: Uploading an Object Using a Signed URL</h4><div class="codecoloring" codetype="Xml" id="obs_04_0080__screen1748071011372"><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></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>DCD2FC9CAB78000001439A51DB2B2577
|
|
x-obs-id-2:<span class="w"> </span>32AAAUJAIAABAAAQAAEAABAAAQAAEAABCTmxB5ufMj/7/GzP8TFwTbp33u0xhn2Z
|
|
ETag:<span class="w"> </span>"1072e1b96b47d7ec859710068aa70d57"
|
|
Date:<span class="w"> </span>Fri,<span class="w"> </span>27<span class="w"> </span>Jul<span class="w"> </span>2018<span class="w"> </span>10:52:31<span class="w"> </span>GMT
|
|
x-obs-version-id:<span class="w"> </span>AAABQ4q2M9_c0vycq3gAAAAAVURTRkha
|
|
Content-Length:<span class="w"> </span>0
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0080__section74231427201219"><h4 class="sectiontitle">Sample Request: Uploading an Object (with a Storage Class Specified)</h4><div class="codecoloring" codetype="Xml" id="obs_04_0080__screen5643202625018"><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>PUT<span class="w"> </span>/object01<span class="w"> </span>HTTP/1.1
|
|
User-Agent:<span class="w"> </span>curl/7.29.0
|
|
Host:<span class="w"> </span>examplebucket.obs.region.example.com
|
|
Accept:<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>04:15:07<span class="w"> </span>GMT
|
|
x-obs-storage-class:<span class="w"> </span>WARM
|
|
Authorization:<span class="w"> </span>OBS<span class="w"> </span>H4IPJX0TQTHTHEBQQCEC:uFVJhp/dJqj/CJIVLrSZ0gpw3ng=
|
|
Content-Length:<span class="w"> </span>10240
|
|
Expect:<span class="w"> </span>100-continue
|
|
|
|
[1024<span class="w"> </span>Byte<span class="w"> </span>data<span class="w"> </span>content]
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0080__section1526805513128"><h4 class="sectiontitle">Sample Response: Uploading an Object (with a Storage Class Specified)</h4><div class="codecoloring" codetype="Xml" id="obs_04_0080__screen26626264501"><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>BB7800000164846A2112F98BF970AA7E
|
|
ETag:<span class="w"> </span>"d41d8cd98f00b204e9800998ecf8427e"
|
|
x-obs-id-2:<span class="w"> </span>a39E0UgAIAABAAAQAAEAABAAAQAAEAABCTPOUJu5XlNyU32fvKjM/92MQZK2gtoB
|
|
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>04:15:07<span class="w"> </span>GMT
|
|
Content-Length:<span class="w"> </span>0
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0080__section66011687493"><h4 class="sectiontitle">Sample Request: Uploading an Object (with a WORM Retention Policy Configured)</h4><pre class="screen" id="obs_04_0080__screen1886417196504">PUT /object01 HTTP/1.1
|
|
User-Agent: curl/7.29.0
|
|
Host: examplebucket.obs.region.example.com
|
|
Accept: */*
|
|
Date: WED, 01 Jul 2015 04:11:15 GMT
|
|
Authorization: OBS H4IPJX0TQTHTHEBQQCEC:gYqplLq30dEX7GMi2qFWyjdFsyw=
|
|
Content-Length: 10240
|
|
<span style="color:#494949;">x-obs-object-lock-mode:</span><span style="color:#494949;">COMPLIANCE</span>
|
|
<span style="color:#494949;">x-obs-object-lock-retain-until-date</span>:<span style="color:#494949;">2022-09-24T16:10:25Z</span>
|
|
Expect: 100-continue
|
|
|
|
<em id="obs_04_0080__i499711468508">[1024 Byte data content]</em></pre>
|
|
</div>
|
|
<div class="section" id="obs_04_0080__section1848934125211"><h4 class="sectiontitle">Sample Response: Uploading an Object (with a WORM Retention Policy Configured)</h4><div class="codecoloring" codetype="Xml" id="obs_04_0080__screen738417546526"><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>BF2600000164364C10805D385E1E3C67
|
|
ETag:<span class="w"> </span>"d41d8cd98f00b204e9800998ecf8427e"
|
|
x-obs-id-2:<span class="w"> </span>32AAAWJAMAABAAAQAAEAABAAAQAAEAABCTzu4Jp2lquWuXsjnLyPPiT3cfGhqPoY
|
|
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>04:11:15<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_0079.html">Operations on Objects</a></div>
|
|
</div>
|
|
</div>
|
|
|