Triggering browser download from front-end is not reliable.
What you should do is, create an endpoint that when called, will provide the correct response headers, thus triggering the browser download.
Front-end code can only do so much. The 'download' attribute for example, might just open the file in a new tab depending on the browser.
The response headers you need to look at are probably Content-Type and Content-Disposition. You should check this answer for more detailed explanation.
Triggering browser download from front-end is not reliable.
What you should do is, create an endpoint that when called, will provide the correct response headers, thus triggering the browser download.
Front-end code can only do so much. The 'download' attribute for example, might just open the file in a new tab depending on the browser.
The response headers you need to look at are probably `Content-Type` and `Content-Disposition`. You should check this [answer][1] for more detailed explanation.
[1]: https://stackoverflow.com/a/20509354/4662933