ASP.NET Overflow or underflow in the arithmetic operation when returning large file bigger 1 GB

后端 未结 3 853
攒了一身酷
攒了一身酷 2021-02-04 02:47

I went across some sort of limitation in ASP.NET. I reduced the problem into a sample project in ASP.NET MVC Project (created with Visual Studio 2010 and .NET 4) and the problem

3条回答
  •  失恋的感觉
    2021-02-04 03:46

    If you are saving a file do the OutputStream so you have to disable the buffer at a line before the .Save command, like this:

                Response.BufferOutput = false; -- <- Must include this line before the Save method
                _zip.Save(Response.OutputStream);
                Response.Flush();
                Response.End();
    

提交回复
热议问题