mardi 11 août 2015

rails paperclip S3 expiring_url download instead of open

I'm using paperclip to upload files to Amazon S3.

I view these files securely thanks to it's expiring_url method:

link_to pic.picture.expiring_url(Picture::EXPIRATION,:medium)

This creates an expiring_url. When clicked, it opens my picture or document in the browser.

How can I do to have the picture or document to be downloaded instead of opened?

Thanks.

Aucun commentaire:

Enregistrer un commentaire