Download a file in a new tab from a controller that requires auth
We want to allow our clients to download files into new tabs like images and PDFs. When we <a href="..." target=_blank ... the tab opens but doesn't have the necessary bearer token to download the file. We tried making it download a blob and then sending the user's browser there, but the url opens as a guid which makes saving the file a real pain because you don't know the original file name. It also doesn't seem to work in mobile.
We are thinking about maybe making secure tokens to allow a one-time non-auth download, but that seems like more work than it should be.
How can I open a file in a new tab that requires a bearer token?
2 Replies
That would've been my idea as well
Something like a SAS token or similar
What does your page look like?
html-wise