返回介绍

1.28.30 upload-part

发布于 2020-10-01 16:22:06 字数 5419 浏览 876 评论 0 收藏 0

Upload part related api supported by FDS

Version: 1.0.0

/{bucketname}/{objectname}

PUT

Summary:

上传一个分片

Description:

必须先通过初始化接口获取一个合法的uploadId

Parameters
NameLocated inDescriptionRequiredSchema
bucketnamepathBucket名字Yesstring
objectnamepath上传的Object名字Yesstring
uploadIdquery初始化分片上传后获取的uploadIdYesstring
partNumberquery分片编号Yesstring
authorizationheader认证信息,计算方式参考签名认证相关文档Nostring
Dateheader请求时间Yesstring
bodybody分片内容Yesbinary
Responses
CodeDescriptionSchema
200请求成功UploadPartResult

Models

UploadPartResult

NameTypeDescriptionRequired
partNumberinteger分片编号No
etagstring分片IDNo
partSizelong分片大小No### 命令行示例
# 上传第一个分片
curl -v -X PUT 'http://cnbj0.fds.api.xiaomi.com/fds-demo/tests/test.txt?uploadId=26287b89-62d7-4527-99ec-41a8fd8794a5&partNumber=1' \
 -H 'content-type: application/octet-stream' \
 -H 'date: Tue, 28 Feb 2017 02:50:54 GMT' \
 --data-binary @./part1
> PUT /fds-demo/tests/test.txt?uploadId=26287b89-62d7-4527-99ec-41a8fd8794a5&partNumber=1 HTTP/1.1
> User-Agent: curl/7.35.0
> Host: cnbj0.fds.api.xiaomi.com
> Accept: */*
> content-type: application/octet-stream
> date: Tue, 28 Feb 2017 02:50:54 GMT
> Content-Length: 10245760
> Expect: 100-continue
> 
< HTTP/1.1 100 Continue
< HTTP/1.1 200 OK
* Server Tengine is not blacklisted
< Server: Tengine
< Date: Tue, 28 Feb 2017 03:18:40 GMT
< Content-Type: application/json
< Content-Length: 78
< Connection: keep-alive
< Access-Control-Allow-Credentials: true
< Access-Control-Max-Age: 1728000
< Access-Control-Allow-Methods: GET, POST, PUT, HEAD, DELETE, OPTIONS
< Access-Control-Allow-Headers: DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization,Content-MD5
< Access-Control-Expose-Headers: content-md5, upload-time, x-xiaomi-meta-content-length
< 
* Connection #0 to host cnbj0.fds.api.xiaomi.com left intact
{"etag":"a0a64b39f67c9bb4d98556454541c2b7","partNumber":1,"partSize":10245760}
# 上传第二个分片
curl -v -X PUT 'http://cnbj0.fds.api.xiaomi.com/fds-demo/tests/test.txt?uploadId=26287b89-62d7-4527-99ec-41a8fd8794a5&partNumber=2' \
 -H 'content-type: application/octet-stream' \
 -H 'date: Tue, 28 Feb 2017 02:50:54 GMT' \
 --data-binary @./part2
> PUT /fds-demo/tests/test.txt?uploadId=26287b89-62d7-4527-99ec-41a8fd8794a5&partNumber=2 HTTP/1.1
> User-Agent: curl/7.35.0
> Host: cnbj0.fds.api.xiaomi.com
> Accept: */*
> content-type: application/octet-stream
> date: Tue, 28 Feb 2017 02:50:54 GMT
> Content-Length: 5
> 
* upload completely sent off: 5 out of 5 bytes
< HTTP/1.1 200 OK
* Server Tengine is not blacklisted
< Server: Tengine
< Date: Tue, 28 Feb 2017 03:05:11 GMT
< Content-Type: application/json
< Content-Length: 71
< Connection: keep-alive
< Access-Control-Allow-Credentials: true
< Access-Control-Max-Age: 1728000
< Access-Control-Allow-Methods: GET, POST, PUT, HEAD, DELETE, OPTIONS
< Access-Control-Allow-Headers: DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization,Content-MD5
< Access-Control-Expose-Headers: content-md5, upload-time, x-xiaomi-meta-content-length
< 
* Connection #0 to host cnbj0.fds.api.xiaomi.com left intact
{"etag":"0d599f0ec05c3bda8c3b8a68c32a1b47","partNumber":2,"partSize":5}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文