ruby aws-sdk多部分上传不符合请求的存储类“STANDARD_IA”

时间:2022-05-20 23:01:56

I'm uploading fairly large objects (~500 MB) using the v2 aws-sdk gem as follows:

我使用v2 aws-sdk gem上传相当大的对象(~500 MB),如下所示:

object = bucket.object("#{prefix}/#{object_name}")
raise RuntimeError, "failed to upload: #{object_name}" unless object.upload_file("#{object_name}", storage_class: "STANDARD_IA")

The uploads succeed and I can see the new objects in the console, but they all have a storage class of "Standard".

上传成功,我可以在控制台中看到新对象,但它们都有一个“标准”的存储类。

When I run this same code with smaller objects they're correctly created with storage class = "STANDARD_IA".

当我使用较小的对象运行相同的代码时,它们是使用storage class =“STANDARD_IA”正确创建的。

Is this a factor of the file size? Or the fact that it's a multi-part upload? Or something else? I didn't see anything in the documentation, but its pretty "expansive" so I may just have missed it.

这是文件大小的一个因素吗?或者它是一个多部分上传的事实?或者是其他东西?我没有在文档中看到任何内容,但它非常“广泛”,所以我可能只是错过了它。

1 个解决方案

#1


1  

Was caused by a bug in aws-sdk-ruby. Pull request:

是由aws-sdk-ruby中的错误引起的。拉请求:

https://github.com/aws/aws-sdk-ruby/pull/1108

https://github.com/aws/aws-sdk-ruby/pull/1108

#1


1  

Was caused by a bug in aws-sdk-ruby. Pull request:

是由aws-sdk-ruby中的错误引起的。拉请求:

https://github.com/aws/aws-sdk-ruby/pull/1108

https://github.com/aws/aws-sdk-ruby/pull/1108