生成了一个比较大的文件——200多M的ZIP文件,下载时会遇到 “System.OutOfMemoryException”错误。

最初以为是IIS配置问题,在网上搜了一些方法,调整设置的大小,仍旧不行。

无意中看到要用 “Response.TransmitFile(fileName)”

之前是用的“Response.WriteFile(fileName)”

试了一下,发现OK了。。。

==============

找到这样一种解释:

Response.TransmitFile() method sends the file to the client machine with out loading it to the Application memory on the server. 

Response.WriteFile() method loads the file that is being downloaded in the Application memory area of the server.