简体   繁体   English

通过载波在S3上下载资产

[英]Downloading assets on S3 through carrierwave

I have a carrierwave uploader chapter_pdf_uploader configured through fog for S3. 我有一个通过雾为S3配置的载波上传器Chapter_pdf_uploader。 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 . 我有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. 如果要向特定用户授予下载权限,则应在系统/应用程序上读取该文件,然后使用send_datasend_file方法将其提供给用户。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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