Streaming large images using ASP.Net Webapi

℡╲_俬逩灬. 提交于 2019-11-28 23:24:33

Yes you can use PushStreamContent. And if you combine it with asynchronous execution (usin i.e. async lambdas), you might get even more effective results.

I have blogged about this approach earlier this month - http://www.strathweb.com/2013/01/asynchronously-streaming-video-with-asp-net-web-api/.

The example used a video file, the principle is the same - pushing down bytes of data to the client.

drzaus

Stream directly from the file using StreamContent (too new?). Similar to Web API Controller convert MemoryStream into StreamContent

httpResponseMessage.Content = new StreamContent(file);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!