且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何从 ASP.net 5 web api 返回文件

更新时间:2023-02-15 19:27:35

使用 IActionResult 而不是 HttpResponseMessage.并返回 FileStreamResult,并使其正常工作.

used IActionResult instead of HttpResponseMessage. And returned FileStreamResult, and got it working.

遇到一个新问题,该文件不是我用来自服务器的流打开的文件.但是会为此创建一个新问题.

Got a new problem, the file is not the one I open with the stream from server. But will create a new question for that.

继续:从 ASP.NET 5 Web API 返回文件

谢谢