fileresult

Stream file using ASP.NET MVC FileContentResult in a browser with a name?

佐手、 提交于 2019-11-26 04:41:02
问题 Is there a way to stream a file using ASP.NET MVC FileContentResult within the browser with a specific name? I have noticed that you can either have a FileDialog (Open/Save) or you can stream the file in a browser window, but then it will use the ActionName when you try to save the file. I have the following scenario: byte[] contents = DocumentServiceInstance.CreateDocument(orderId, EPrintTypes.Quote); result = File(contents, \"application/pdf\", String.Format(\"Quote{0}.pdf\", orderId));