ASP.NET MVC FileStreamResult, fileDownloadName is not used
问题 The following returns a PDF which the browser tries to directly display inline. This works correctly. However, if I try to download the file, the download name is not "myPDF.pdf", but instead the ID in the route (myapp/controller/PDFGenerator/ID). Is it possible to set the file download name to be "myPDF.pdf"? public FileStreamResult PDFGenerator(int id) { MemoryStream ms = GeneratePDF(id); byte[] file = ms.ToArray(); MemoryStream output = new MemoryStream(); output.Write(file, 0, file.Length