In my ApiController class, I have following method to download a file created by server.
public HttpResponseMessage Get(int id) { try { strin
If you are using ASP.NET Core MVC, the answers above are ever so slightly altered...
In my action method (which returns async Task) I add the line (anywhere before the return statement):
async Task
Response.Headers.Add("Content-Disposition", $"attachment; filename={myFileName}");