开发者

Can you use multipart upload in boto with strings instead of a file handler?

开发者 https://www.devze.com 2023-03-02 15:09 出处:网络
Is it possible to use the S3 multipart upload with strings instead of a file? The strings i am using are being generated during the upload process and so the size and the exact content is unknown the

Is it possible to use the S3 multipart upload with strings instead of a file? The strings i am using are being generated during the upload process and so the size and the exact content is unknown the time the multipart upload st开发者_高级运维arts.


There is no explicit "upload_part_from_string" method available. You could probably use StringIO to wrap a file-like object around the string and then pass that to "upload_part_from_file" but I haven't tested that.

It would be easy to add this method. At the time I didn't think it would be all that useful since each of the parts has to be a minimum of 5MB and that's a pretty big string. But if you have a use case for it, let me know. Or, fork boto on github, add the method and send a pull request.

0

精彩评论

暂无评论...
验证码 换一张
取 消