How to download an uploaded file in Cloudinary

Multi tool use


How to download an uploaded file in Cloudinary
i'm currently working on how to download an uploaded file in Cloudinary.
In my views/declarations/index
, I want a button to download the file the user uploaded at the Declaration.create
.
views/declarations/index
Declaration.create
I've tried the this :
<% @declarations.each do |declaration| %>
<tr>
<td><%= link_to("Download", cl_private_download_url(declaration.facture, :png, :attachment => true)) %></td>
</tr>
<% end %>
But all I have is something like this : #Attachinary::File:0x00007fa7deca0f20
Does one of you know how could I do this ?
Many thanks,
Have you also tried this btw, seems you can get a direct download link afterall: support.cloudinary.com/hc/en-us/articles/…
– bo-oz
3 hours ago
Thanks for you answer. Yeah, I just saw this website before you posted it :p But it returned me an error : Invalid Signature. Gonna find out what is this.
– Enner31
3 hours ago
This is still not working ... I've update my answer, if you have any other solution.
– Enner31
5 mins ago
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
You need to link to a controller method that actually handles the file transfer. This method receives the declaration ID, pulls the record, fetches the file, and serves it.
– bo-oz
3 hours ago