我有一个ashx处理程序与下面的代码。我们的想法是隐藏文件的路径,并提示下载System.OutOfMemoryException下载文件
context.Response.Clear();
context.Response.AddHeader("Content-Disposition", "attachment; filename=" + fileName);
context.Response.AddHeader("Content-Length", file.Length.ToString());
context.Response.ContentType = "application/octet-stream";
context.Response.WriteFile(file.FullName);
也能正常工作一段然而文件对别人我得到
异常类型“System.OutOfMemoryException的”被抛出。
在卡西尼? IIS? – JoeBilly 2010-04-08 12:33:14
抛出异常的文件的长度是多少? – kgiannakakis 2010-04-08 12:33:56
它是IIS7,所有文件的大小都是7mb。有时候是有效的。我想我应该在使用声明中包装这个。任何想法应该实现什么 – frosty 2010-04-08 13:26:09