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处