rails101
rails101

Reputation: 3

download images from s3

I have 4000 images on my amazon s3. Now i need to download 3000 of them which are uploaded by specific user to my local. How can i achieve this. Thanks.

Update:

Url is something like that and it is public. http://s3.amazonaws.com/mybucket/photos/3/3acb36fc9a540e6543ad62b4a61f76bb.jpg

@photo = Photo.first
@photo.attachment.url #gives me the url

Upvotes: 0

Views: 1508

Answers (3)

brettish
brettish

Reputation: 2648

If you have a significant amount of data to upload/download you can use AWS import/export. Instead of performing the upload/download via the internet you ship them a hard drive. There is a flat fee plus a nominal per hour fee. Like I said, if we are talking about a significant number of GB, then this is an attractive alternative.

Upvotes: 0

invertedlambda
invertedlambda

Reputation: 606

I tried going to your URL, it seems like is restricted - though that's no biggie.

Like the poster commented above, if "3" is tied to a specific user, all you need to do is get the full list of contents of that bucket and then gather a list of URLs. Then you could use ruby or wget/curl to download those files to your machine.

If you want to browse with a tool, I like S3Hub (Mac only).

Does that help? If you provide more information about how the URL structure maps to a user, we'll be better able to help you.

I saw in your comment above that it needs to be done by user_id. Do you have a mapping between uploads and users?

The real key to solving your problem is being able to associate a user to their many uploads (and corresponding URLs in S3).

Upvotes: 1

Geoff Appleford
Geoff Appleford

Reputation: 18832

Is this a one-off transfer? Does it have to be done programatically?

You can use a GUI tool such as Bucket Explorer or Cloudberry explorer. Both have free versions available.

Assuming the 'subfolder' /3/ contains all the photos by the particular user you are interested in, you can easily filter the bucket to display the photos in that folder and download them to your local system.

Upvotes: 0

Related Questions