Google Cloud Storage 支持 S3 分段上传

Google Cloud Storage support of S3 multipart upload

目前,我在 "interoperability mode" 中使用 GCS 使其接受 S3 API 请求。使用官方的multipart upload example here(+设置合适的endpoint),第一次发起POST请求:

POST /bucket/object?uploads HTTP/1.1
Host: storage.googleapis.com
Authorization: AWS KEY:SIGNATURE
Date: Wed, 07 Jan 2015 13:34:04 GMT
User-Agent: aws-sdk-java/1.7.5 Linux/3.13.0-43-generic Java_HotSpot(TM)_64-Bit_Server_VM/24.72-b04/1.7.0_72
Content-Type: application/x-www-form-urlencoded; charset=utf-8
Transfer-Encoding: chunked
Connection: Keep-Alive

此响应的结果:

HTTP/1.1 400 Bad Request
Content-Length: 55
Date: Wed, 07 Jan 2015 13:34:05 GMT
Server: UploadServer ("Built on Dec 19 2014 ...")
Content-Type: text/html; charset=UTF-8
Alternate-Protocol: 443:quic,p=0.02

The request's content type is not accepted on this URL.

会不会是 AWS 客户端问题或者 GCS 还不支持 S3 的分段上传?

我尝试过的大多数其他操作(下载对象、列出存储桶对象等)似乎都可以正常工作。

更新:自 2021 年 5 月起,Google 云存储 (GCS) 支持与 S3 兼容的分段上传。
https://cloud.google.com/storage/docs/multipart-uploads

一旦您配置了适当的端点,AWS SDK 将无缝运行。

GSC 不支持 S3 分段上传接口。 如果您想执行块并行上传,您可以使用对象组合 - 请参阅 https://cloud.google.com/storage/docs/composite-objects

Google 云存储 (GCS) now supports the S3-style multipart upload API。因此,像这个问题中的用例应该可以正常工作。