我正在尝试从ASP.NET MVC控制器下载一个100MB的文件,但是我会在3-4分钟后得到超时(它会有所不同)。
public ActionResult DownloadMyFile() {
Server.ScriptTimeout = 60 * 60; // 1 hr timeout for downloading myfile
Response.AddHeader("Content-Disposition", "attachment; filename=myfile");
Response.BufferOutput = false;
this.CloudBlobContainer
.GetBlobReference("myfile")
.DownloadToStream(Response.OutputStream);
return new EmptyResult();
}
答案 0 :(得分:0)
您可以尝试在web.config中增加执行超时。
以下将超时更改为1小时(3600秒):
<system.web>
<httpRuntime
executionTimeout="3600"
/>