I have this code:
<%= link_to "download", "https://region.amazonaws.com/bucket/file.html" %>
I want to download this file as it is, instead of opening it in browser. Any ideas? Thanks!
I have this code:
<%= link_to "download", "https://region.amazonaws.com/bucket/file.html" %>
I want to download this file as it is, instead of opening it in browser. Any ideas? Thanks!
Read here about possible options. In short:
server should respond with correct response headers in order for browser to recognise the file should be downloaded (and not displayed)
use HTML5 <a href="file.html" download="myfile.html">
attribute (not supported in IE and Safari)
Thanks Lenart, that helped.