我刚刚在 Heroku 上托管的 Rails 应用程序中实现了回形针。该应用程序似乎连接并将图像上传到 s3。以下是我在应用程序上提交表单时的一些日志示例:
2013-06-01T17:52:45.112448+00:00 app[web.1]: Parameters: {"utf8"=>"✓", "authenticity_token"=>"2/vRFLrAnBnokNwohVfMhG74d3HN0/GTwype2jGJm9w=", "illustration"=>{"name"=>"Test", "illustrator"=>"Test", "image"=>#<ActionDispatch::Http::UploadedFile:0x000000050d9a58 @original_filename="DEISIGN_Cover_Illustration.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"illustration[image]\"; filename=\"DEISIGN_Cover_Illustration.jpg\"\r\nContent-Type: image/jpeg\r\n", @tempfile=#<File:/tmp/RackMultipart20130601-12-v7uo9s>>, "edition_id"=>"17", "tag_list"=>"Test", "description"=>"Test"}, "commit"=>"Update Illustration", "id"=>"199"}
2013-06-01T17:52:45.113280+00:00 app[web.1]: [AWS S3 200 0.424977 0 retries] head_object(:bucket_name=>"haggard",:key=>"illustrations/images/000/000/199/original/DEISIGN_Cover_Illustration.jpg")
2013-06-01T17:52:45.113496+00:00 app[web.1]:
2013-06-01T17:52:45.113496+00:00 app[web.1]: [AWS S3 200 0.085094 0 retries] head_object(:bucket_name=>"haggard",:key=>"illustrations/images/000/000/199/thumb/DEISIGN_Cover_Illustration.jpg")
2013-06-01T17:52:45.113496+00:00 app[web.1]:
2013-06-01T17:52:45.624956+00:00 app[web.1]: [AWS S3 204 0.099689 0 retries] delete_object(:bucket_name=>"haggard",:key=>"illustrations/images/000/000/199/original/DEISIGN_Cover_Illustration.jpg")
2013-06-01T17:52:45.624956+00:00 app[web.1]:
2013-06-01T17:52:45.715606+00:00 app[web.1]: [AWS S3 204 0.09001 0 retries] delete_object(:bucket_name=>"haggard",:key=>"illustrations/images/000/000/199/thumb/DEISIGN_Cover_Illustration.jpg")
2013-06-01T17:52:45.715606+00:00 app[web.1]:
2013-06-01T17:52:46.835310+00:00 app[web.1]: [AWS S3 200 1.116787 0 retries] put_object(:acl=>:public_read,:bucket_name=>"haggard",:content_length=>575121,:content_type=>"image/jpeg",:data=>Paperclip::UploadedFileAdapter: DEISIGN_Cover_Illustration.jpg,:key=>"illustrations/images/000/000/199/original/DEISIGN_Cover_Illustration.jpg")
2013-06-01T17:52:46.835310+00:00 app[web.1]:
2013-06-01T17:52:47.011793+00:00 app[web.1]: [AWS S3 200 0.173532 0 retries] put_object(:acl=>:public_read,:bucket_name=>"haggard",:content_length=>6096,:content_type=>"image/jpeg",:data=>Paperclip::FileAdapter: DEISIGN_Cover_Illustration20130601-12-6ldegn20130601-12-1ytcjd0,:key=>"illustrations/images/000/000/199/thumb/DEISIGN_Cover_Illustration.jpg")
2013-06-01T17:52:47.011793+00:00 app[web.1]:
2013-06-01T17:52:47.020929+00:00 app[web.1]: Redirected to http://visualhaggard.org/illustrations/199
我上传的图像出现在我的 S3 存储桶控制台中。
我的视图用于@illustration.image.url
获取要显示的图像。
我没有在任何地方为图像设置权限。它们是否会自动为应用程序正确设置以上传和下载图像?
谢谢。