开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜