Reputation: 73
I use the following piece of HTML to let a user download documents from the server:
<tr *ngFor="let document of documents">
<td><a href="/api/file/GetDocumentById?id={{document.id}}" download="{{document.name}}">{{document.name}}</a></td>
</tr>
Here, the download attribute sets the name of the downloaded file. This works in Chrome, but I just discovered that when using Edge, the file gets the name of the controller (GetDocumentById) instead.
Does anyone have an easy solution that sets the name of the downloaded file correctly?
Upvotes: 2
Views: 1324
Reputation: 6565
Download attribute is supported in following version of edge browser, make sure you are using edge version >= 17
Reference: https://caniuse.com/#search=download
Upvotes: 1