Steve Frank
2013-10-10 16:13:15 UTC
I need to copy large files from a customer's bucket to ours. I implemented
code to download file in chunks, but would now also like to upload in
chunks so I can bypass having to store in a temp file locally first.
File.open(ltmpfilepath, mode='wb') do |ltmpfile|
remoteDir.files.get(rfilename) {|chunk, remaining, total|
ltmpfile.write chunk
#Instead of writing to a temp file above, i want to pass this along
to put_object
}
end
I know that put_object takes in a string or file, so I suspect I can pass
in some other object that implements an expected interface, just not sure
which. (I would solve this with streams in the c# world)
Thanks!
-Steve
code to download file in chunks, but would now also like to upload in
chunks so I can bypass having to store in a temp file locally first.
File.open(ltmpfilepath, mode='wb') do |ltmpfile|
remoteDir.files.get(rfilename) {|chunk, remaining, total|
ltmpfile.write chunk
#Instead of writing to a temp file above, i want to pass this along
to put_object
}
end
I know that put_object takes in a string or file, so I suspect I can pass
in some other object that implements an expected interface, just not sure
which. (I would solve this with streams in the c# world)
Thanks!
-Steve
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-fog+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-fog+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.