轨道3 +回形针+亚马逊S3 +下载所有图片 [英] Rails 3 + Paperclip + Amazon S3 + Download All Images

查看:216
本文介绍了轨道3 +回形针+亚马逊S3 +下载所有图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  • 在我已经运行在Heroku上为2年以上一轨3.XX应用程序。
  • 用户上传的图片是通过回形针存储在Amazon S3的桶中。
  • 我想已上载(约5000张图片总数)所有图像下载到本地硬盘。
  • 我想减少执行此查询所需的成本。
  • 在卖场如何回形针文件我在S3上的知识逃脱了我(应用程序写近3年前)。
  • 在S3控制台中查看桶的内容列出这似乎是包含一个链接到图像元数据的文本文件。
  • 我似乎无法找到桶本身(通过S3 Web控制台)中的任何图像文件。
  • 我已经试过各种应用,如 Cyber​​duck的和的吊桶但他们都超时试图请求桶的内容。
  • 这似乎很奇怪,我的生产水桶只包含元数据的文本文件描述图像的位置;为什么我不能在控制台中看到自己的影像?
  • 有一些简单的脚本,我可以运行抓住所有的图像?
  • I've tried various applications like Cyberduck and Buckets but they all time out trying to request the bucket's content.
  • It seems odd that my production bucket only contains meta-data text files describing an image's location; why can't I see the images in the console itself?
  • Is there some easy script I can run to grab all images?

推荐答案

你能提供有关在模型中声明你的 has_​​attached_file 法一些额外的信息?

Can you provide some additional information about your has_attached_file method declared in your model?

您可以做这样的事情假设你有 has_​​attached_file:照片

You could do something like this assuming you have has_attached_file :photo:

Model.find_each do |record|
  puts record.photo.url
end

看跌显然只显示你的网址。你会想脚本遍历列表,并与卷曲或wget的获取它们。

puts will obviously just show you the URL. You'll want to script iterating over the list and fetching them with curl or wget.

这篇关于轨道3 +回形针+亚马逊S3 +下载所有图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆