Stream zip file MVC.NET start streaming

后端 未结 2 1560
半阙折子戏
半阙折子戏 2021-01-02 21:53

I\'m trying to create a method which continually streams a zip file as a user downloads it (so that there is no wasted streaming)

I added a thread.sleep to simulate

相关标签:
2条回答
  • 2021-01-02 22:49

    I think you might need to be flushing the outputstream rather than the zipostream to see any output to http. So response.OutputStream.Flush() would appear in your loop in that case. Not sure if it will actually solver your problem though.

    0 讨论(0)
  • 2021-01-02 22:59

    Assuming the zip format is partial to streaming, your problem is that your response is being buffered by default. If you set HttpResponseBase.BufferOutput to false, it should start streaming immediately.

    0 讨论(0)
提交回复
热议问题