无法在多线程调用C#MVC中下载文件

时间:2018-12-17 07:05:38

标签: c# asp.net asp.net-mvc multithreading task

public ActionResult Download(string fileGuid, string fileName)
{          
     var File = MyMethod(fileGuid, fileName);
return File;
}

public virtual ActionResult MyMethod(string fileGuid, string fileName)
{
    //Gets Download data 
    Response.AppendHeader("Content-Disposition", "attachment"))
    //refers filelocation which the file
    return File( filelocation, contentType);/
}

如果将方法调用置于线程中,则无法下载文件。我收到以下错误:

  

{“值不在预期范围内。”}在Response.AppendHeader处

0 个答案:

没有答案