Non-tech founder’s guide to choosing the right software development partner Download Ebook
Home>Blog>Force downloading of file in shrine 3

Force Downloading of File in Shrine 3

Usually we get link to file like this:

irb(main):001:0> Document.last.asset.url

=> ""

But in this case, this file will be opened in browser.

If you want to force download file you should add response_content_disposition and make private link (if it’s not true):

irb(main):002:0> Document.last.asset.url(public: false, response_content_disposition: "attachment")

=> ""

Discover More Reads

Real Stories & Real Success

Do you have a tech idea?

Let’s talk!

By submitting this form, you agree with JetRockets’ Privacy Policy

If you prefer email, write to us at