Authenticated URLS

2,895 views
Skip to first unread message

Andrew

unread,
Jul 28, 2011, 1:18:57 PM7/28/11
to carrierwave
I'm using S3 and trying to set up expiring URLS. I see in the docs
regarding Fog > File that there's an "authenticated_url" method, but I
haven't been able to get it to work.

Given a model called "Photo" with an uploader mounted on "image", I
tried the following:

p = Photo.first
p.image_url #correctly returns url on AmazonS3
p.authenticated_url #NoMethodError
p.image.authenticated_url #NoMethodError

I don't understand how this is supposed to work. Help?

Trevor Turk

unread,
Aug 1, 2011, 2:51:20 PM8/1/11
to carri...@googlegroups.com
I think you want to set "fog_public" to false and use the "url" method as usual. 

Andrew Burleson

unread,
Aug 2, 2011, 1:00:30 AM8/2/11
to carri...@googlegroups.com
Ok, this helps. One more question: It looks like the expiration time for files is a global config option. Is there a way to override this on specific url calls?

IE, something like… `model.asset_url(:full_size, :expiration => 600 )`

On Aug 1, 2011, at 1:51 PM, Trevor Turk wrote:

I think you want to set "fog_public" to false and use the "url" method as usual. 

--
You received this message because you are subscribed to the Google Groups "carrierwave" group.
To view this discussion on the web visit https://groups.google.com/d/msg/carrierwave/-/lEVK-6WzOjwJ.
To post to this group, send email to carri...@googlegroups.com.
To unsubscribe from this group, send email to carrierwave...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/carrierwave?hl=en.

Trevor Turk

unread,
Aug 5, 2011, 2:17:14 PM8/5/11
to carri...@googlegroups.com
I'm not sure. Give it a try and if it doesn't work and you'd like to add a new feature, pull requests are always welcome!
Reply all
Reply to author
Forward
0 new messages