gal
gal

Reputation: 302

problem when uploading photos to Amazon s3 using paperclip

my model:

  has_attached_file :avatar, :styles => { :thumb => "65x65>" },
  :storage => :s3,
  :s3_credentials => "#{RAILS_ROOT}/config/s3.yml",
  :bucket => "doweet-image", 
  :path => ":attachment/:id/:style.:extension"

when i'm uploading an image to amazon s3, and putting this on the view:

<%= image_tag(current_user.avatar.url(:small))%>

the photo does not show up, and when i'm copy the link the src photo this is:

http://s3.amazonaws.com/doweet-image/avatars/1/small.jpg?1311356386

and when i going to the link i'm getting there this error:

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>152EBFC9033E6633</RequestId>
<HostId>
Iw3zWXuCC6JjPAJig+pBVqQbLilN4dmTY4VooVO5CVKCH3O/MN3VDawXbI6Zd5NP
</HostId>
</Error>

Upvotes: 2

Views: 1474

Answers (1)

Chris Barretto
Chris Barretto

Reputation: 9529

Go into your s3 bucket and make sure that your folder has read access to all. Looks like it is finding the image, but doesn't have read access.

If you are using a Mac, I'd suggest Transmit, but I'm sure going through the web interface would suffice.

Upvotes: 2

Related Questions