I have a signed Amazon S3 URL which points to a PDF file in a bucket
I want to download this file, not redirect/display it when a button is clicked.
I had figured something like this
Router.route('download', {
path: '/d/:signedURL',
onAfterAction: function() {
var req = this.request;
var res = this.response;
res.setHeader('Content-disposition', 'attachment; filename=' + this.params.signedURL);
console.log(req, res);
}
}, {where: 'server'});
But can't get it to work, any advice?
EDIT:
Request URL:chrome-extension://invalid/
Request Headers
Provisional headers are shown
Referer:http://localhost:3000/d/https%3A/s3.amazonaws.com/tabler-development/08867c4b0guX7REeBvLHdLaMM%253D
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36
X-DevTools-Request-Initiator:frontend