Question

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 starts.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top