I'm sending a file to the browser to be saved locally. This works fine in all browsers except Microsoft Edge, where it replaces the filename with a guid. The file has to be downloaded with a specific filename, is there an explanation or workaround for this problem? My answer "don't use Edge" will be rejected.
var response = new HttpResponseMessage(HttpStatusCode.OK)
{
Content = new ByteArrayContent(CreateFile(fileContents))
};
response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");
response.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment")
{
FileName = string.Concat(fileName, ".xlsx")
};