In my ApiController class, I have following method to download a file created by server.
public HttpResponseMessage Get(int id)
{
try
{
strin
You need to set the Content-Disposition header on the HttpResponseMessage:
HttpResponseMessage response = new HttpResponseMessage();
response.StatusCode = HttpStatusCode.OK;
response.Content = new StreamContent(result);
response.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment")
{
FileName = "foo.txt"
};