Download Anchor Link With Authorization Header
I have a link that I would like to add to my javascript (Marionette/Backbone) single page application that will download an Excel file to the user's local drive via the browser's f
Solution 1:
This not possible, because the only way to add HTTP headers is using the XHR, but XHR cannot be used to download files.
You could however use cookies to do that.
- Just set the cookie, with a returned value from the server.
- Wait till the user clicks the link.
- Invalidate the cookie after the user clicked the link.
Post a Comment for "Download Anchor Link With Authorization Header"