【发布时间】:2015-06-12 08:45:11
【问题描述】:
我使用 Paperclip 将图像存储在 S3 中,并且此错误间歇性地出现。几周前我通过升级到 ruby 2.1.5 解决了这个问题,但现在又回来了。
这是我的控制器代码:
def download
extension = File.extname(@gallery_photo.image_file_name)
send_data open("#{@gallery_photo.image.expiring_url(10, :original)}").read, filename: "original_#{@gallery_photo.id}#{extension}", type: @gallery_photo.image_content_type
end
这是错误:
OpenURI::HTTPError (403 Forbidden):
Rails 4 和 Ruby 2.1.5
【问题讨论】:
-
我也有同样的问题,只是一些照片......有什么想法吗?