Hi,
I’m using the aws-s3-ruby and boxr gems to transfer large video files from S3 to Box. Both gems allow you to download and upload files in chunks and that’s easy when you’re reading or writing files from disk. However I can’t figure out how to transfer data from S3 to Box in chunks with a StringIO object.
When I call Boxr::Client#upload_file_from_io
with a StringIO object from Aws::S3::Client#get_object
it results in an exception:
RuntimeError: TypeError no implicit conversion of StringIO into String
filename = "video.mp4"
root_folder_id = "0"
s3_response = s3_client.get_object(bucket: video_bucket, key: filename)
box_client.upload_file_from_io(s3_response.body, root_folder_id, filename)
Do I need to convert the StringIO into a regular IO object in order for it to work with Boxr?
Links:
- Add support for chunked uploads #87
- Add support for chunked uploads #87
- Use io.size instead of File.size to accept StringIO #106
- Boxr gem list of chunked upload methods
- Box documentation for chunked uploads
- S3 ruby client documentation for get_object