1

We are looking to support export of photos from our S3 location to users' Dropbox. Currently I am using the code like below:

@photo = Photo.find(id) #Photo.image has attachment
@photo.image.copy_to_local_file(nil, 'tmp/png/temp.png') #Get the file locally from S3
local_file = File.open('tmp/png/temp.png') 
response = client.put_file('sample.png', local_file) # Then copy to Dropbox

The above method costs twice the bandwidth. Is there anyway I can transfer the images directly from S3 to Dropbox without copying them locally?

Thanks in advance!

Dhanush
  • 104
  • 1
  • 4

1 Answers1

1

How about trying something like mover and use their APIs?

https://mover.io/

http://support.mover.io/knowledgebase/articles/214572-how-to-transfer-or-backup-your-amazon-s3-buckets-t

Or you can also try SME Storage (Storage Made Easy)

http://storagemadeeasy.com/

It's kinda ironic that DropBox uses Amazon S3 to stores all its files.

Or you can also write your own streamer in Ruby and run it in an Amazon instance it will be much faster since all the data would be within Amazon.

How do I HTTP post stream data from memory in Ruby?

Community
  • 1
  • 1
Rico
  • 58,485
  • 12
  • 111
  • 141
  • Thanks Rico for laying out different options. Looks like some of them do cost. So I am going to stick with the current solution until the costs get prohibitively high at which point 3rd party moving apis might make sense. Also yah it is ironic that Dropbox using Amazon S3 as well. Thanks again! – Dhanush Jan 06 '14 at 20:52