Last update:2023-09-26 18:29:00
Upload data using a form-based method, suitable for HTML forms, and it requires IAM wos:PutObject permissions.
POST / HTTP/1.1
Host: Bucket.Endpoint
Keep-Alive: 300
Connection: keep-alive
Content-Type: multipart/form-data; boundary=-9431149156168
Content-Length: length
--9431149156168
Content-Disposition: form-data; name=”key”
key
--9431149156168
Content-Disposition: form-data; name=”content-Type”
content_type
--9431149156168
Content-Disposition: form-data; name=”x-wos-meta-*”
x-wos-meta-*
--9431149156168
Content-Disposition: form-data; name=”content-MD5”
content_MD5
--9431149156168
Content-Disposition: form-data; name=”policy”
policy=
--9431149156168
Content-Disposition: form-data; name=”signature”
signature=
--9431149156168
Content-Disposition: form-data; name=”file”; filename=”MyFilename”
Content-Type: image/jpeg
fil_content
--9431149156168
Content-Disposition: form-data; name=”submit”
Upload to WCS
--9431149156168—
None.
Please use common request headers.
Parameter | Description | Required |
---|---|---|
key | The name of the object created by this request. | Yes |
file | Content of the object.Type:Binary or text typeRestriction:Only one file parameter can be included in a request. | Yes |
content-type | MIMEtype, indicating the format of object content to upload. | No |
Content-MD5 | The MD5 of object data to upload, if the data is damaged during transmission, than response 403 SignatureDoesNotMatch will be returned to notice you that the MD5 is inconsistent with the orgin. | No |
x-wos-meta-* | Customized metadata, which will be returned as it is in headObject and getObject. | No |
Object Body
HTTP/1.1 status_code
x-wos-request-id: request id
Content-Type: type
Location: location
Date: date
ETag: etag
Server:WS-web-server
In addition to Common Headers, it also contains
Element name | description |
Etag | Entity tag of uploaded data |
None.
POST /object HTTP/1.1
Date: Fri, 18 May 2017 01:19:49 GMT
Host: bucket.s3-cn-east-1.wcsapi.com
Content-Type: multipart/form-data; boundary=---------------------------7db143f50da2
Content-Length: 2424
Content-Disposition: form-data; name="AWSAccessKeyId"
94963ba9c9ebb26620acf4d8aac40b72c5706c6a
-----------------------------7db143f50da2
Content-Disposition: form-data; name="key"
object01
-----------------------------7db143f50da2
Content-Disposition: form-data; name="acl"
public-read
-----------------------------7db143f50da2
Content-Disposition: form-data; name="content-type"
text/plain
-----------------------------7db143f50da2
Content-Disposition: form-data; name="policy"
eyJjb25kaXRpb25zIjogW3siYWNsIjogInB1YmxpYy1yZWFkIn0sIHsiYnVja2V0IjogIndzdGVzdC0yIn0sIHsia2V5IjogInYydDEudHh0In0sIFsiY29udGVudC1sZW5ndGgtcmFuZ2UiLCAxMDQ4NTc5LCAxMDQ4NTc2MF1dLCAiZXhwaXJhdGlvbiI6ICIyMDE3LTEyLTEzVDA3OjU0OjU5LjEzWiJ9
-----------------------------7db143f50da2
Content-Disposition: form-data; name="signature"
+c+e164E4cZ7J1WEVp/BKEI91bs=
-----------------------------7db143f50da2
Content-Disposition: form-data; name="file"; filename="C:\Testtools\UpLoadFiles\object
\1024Bytes.txt"
Content-Type: text/plain
01234567890
-----------------------------7db143f50da2
HTTP/1 100 Continue
HTTP/1 200 OK
x-wos-request-id: 90E2BA00C26C00000133B442A90063FD
Date: Fri, 18 May 2017 01:20:27 GMT
ETag: "ab7abb0da4bca5323ab6119bb5dcd296"
Content-Length: 0
Connection: close
Server: WS-Web-Server