Download anchor link with authorization header

别来无恙 提交于 2019-12-03 22:32:22
Artjom B.

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.

  1. Just set the cookie, with a returned value from the server.
  2. Wait till the user clicks the link.
  3. Invalidate the cookie after the user clicked the link.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!