简体   繁体   中英

Downloading assets on S3 through carrierwave

I have a carrierwave uploader chapter_pdf_uploader configured through fog for S3. I can make that resource available for download through a view with -

<% @chapters.each do |chapter| %>
  <%= link_to 'download pdf', "#{chapter.chapter_pdf}" %>
  .....

Is this safe?

I have config.fog_public = false .

No this is not safe at all. If it's downloadable to some user using direct link you provided. Then anyone can download using the link. If you want to give permission for download to specific users then you should read that file on your system/app then make it available to your user using send_data or send_file methods.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM