forked from laiweijian4/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>
585 lines
50 KiB
HTML
585 lines
50 KiB
HTML
<a name="obs_04_0080"></a><a name="obs_04_0080"></a>
|
|
|
|
<h1 class="topictitle1">Uploading Objects - 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 bucket creation 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 on 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> parameter in the request header. After receiving the request, OBS will perform an MD5 consistency check. If the two MD5 values are inconsistent, the system returns an error message.</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. The request lines of the two methods are 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 Objects - 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__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.6.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.6.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.6.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.6.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.6.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.6.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.6.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.6.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.6.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.6.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.6.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 objects and obtain 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.6.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.6.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.6.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.6.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.6.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.6.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.6.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.6.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.6.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, obtain the object 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.6.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.6.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.6.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 value options: <strong id="obs_04_0080__b4435141185710">STANDARD</strong> (Standard), <strong id="obs_04_0080__b768142405719">WARM</strong> (Warm), <strong id="obs_04_0080__b831518319579">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.6.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.6.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.6.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.6.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.6.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.6.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.6.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.6.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.6.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.6.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.6.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.6.4.2.4.1.2 "><p id="obs_04_0080__p27399486">Master key ID. This header is used in SSE-KMS mode. If the customer does not provide the master key ID, the default master key ID will be used. If there is no such a default master key, the system will create one and use it by default.</p>
|
|
<p id="obs_04_0080__p45268789">Type: string</p>
|
|
<p id="obs_04_0080__p6679135313114">The following two formats are supported:</p>
|
|
<p id="obs_04_0080__p486340133414">1. <em id="obs_04_0080__i121978588519">regionID</em><strong id="obs_04_0080__b101976586515">:</strong><em id="obs_04_0080__i41971458459">domainID</em><strong id="obs_04_0080__b21981958858">:key/</strong><em id="obs_04_0080__i219811583520">key_id</em></p>
|
|
<p id="obs_04_0080__p090816596123">2. <em id="obs_04_0080__i16331559111815">key</em><strong id="obs_04_0080__b945855315185">_</strong><em id="obs_04_0080__i733205910182">id</em></p>
|
|
<p id="obs_04_0080__p558627121315"><em id="obs_04_0080__i84651346143717">regionID</em> is the ID of the region to which the key belongs. <em id="obs_04_0080__i64652462371">domainID</em> is the account ID of the tenant to which the key belongs. <em id="obs_04_0080__i24652046143715">key_id</em> is the key ID created in KMS.</p>
|
|
<p id="obs_04_0080__p17830152818144">Example:</p>
|
|
<p id="obs_04_0080__p887642112425">1. x-obs-server-side-encryption-kms-key-id:<em id="obs_04_0080__i1826125311361">region</em>:domainiddomainiddomainiddoma0001: key/4f1cd4de-ab64-4807-920a-47fc42e7f0d0</p>
|
|
<p id="obs_04_0080__p9879721204216">2. x-obs-server-side-encryption-kms-key-id: 4f1cd4de-ab64-4807-920a-47fc42e7f0d0</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="9%" headers="mcps1.3.6.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.6.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.6.4.2.4.1.2 "><p id="obs_04_0080__p56204044">Encryption algorithm. The header is used in SSE-C mode.</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.6.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.6.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.6.4.2.4.1.2 "><p id="obs_04_0080__p2668111">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_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.6.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.6.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.6.4.2.4.1.2 "><p id="obs_04_0080__p3925735">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_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.6.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.6.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.6.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.6.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.6.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.6.4.2.4.1.2 "><p id="obs_04_0080__p038312375711">Specifies when an object expires. It is measured in days. An object will be automatically deleted once it expires. (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.6.4.2.4.1.3 "><p id="obs_04_0080__p1014357105719">No</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 following message headers may also be used. For details, see <a href="#obs_04_0080__table24122936102344">Table 2</a>.</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.9.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.9.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.9.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.9.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.9.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.9.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.9.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.9.4.2.3.1.2 "><p id="obs_04_0080__p43709291">Indicates the master key ID. This header is included in a response if 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> is the ID of the region to which the key belongs. <em id="obs_04_0080__i1119611917578">domainID</em> is the account ID of the tenant to which the key belongs. <em id="obs_04_0080__i98931215155718">key_id</em> is 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.9.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.9.4.2.3.1.2 "><p id="obs_04_0080__p48701810">An encryption algorithm. This header is included in a response if 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.9.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.9.4.2.3.1.2 "><p id="obs_04_0080__p19285144">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_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.9.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.9.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__b142242621220610">WARM</strong> or <strong id="obs_04_0080__b39795655420610">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 involves 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 1</h4><p id="obs_04_0080__p16805120122416"><strong id="obs_04_0080__b10583142141614">Upload an object.</strong></p>
|
|
<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 1</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 2</h4><p id="obs_04_0080__p175836310242"><strong id="obs_04_0080__b848013931615">Set the ACL when uploading an object.</strong></p>
|
|
<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 2</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 3</h4><p id="obs_04_0080__p10219554142417"><strong id="obs_04_0080__b1701112201618">Upload objects when versioning is enabled for the bucket.</strong></p>
|
|
<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 3</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 4</h4><p id="obs_04_0080__p121691112513"><strong id="obs_04_0080__b14551831131611">MD5 is carried when an object is uploaded.</strong></p>
|
|
<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 4</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 5</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 5</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 6</h4><p id="obs_04_0080__p1017842217253"><strong id="obs_04_0080__b1833615491335">Upload an object and carry the signature in the URL</strong>.</p>
|
|
<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 6</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 7</h4><p id="obs_04_0080__p1848764072413"><strong id="obs_04_0080__b658271681612">Upload an object of a specified storage class.</strong></p>
|
|
<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 7</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>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="obs_04_0079.html">Operations on Objects</a></div>
|
|
</div>
|
|
</div>
|
|
|