在我的控制器中,这是我拥有的代码
public FileResult Download(string file)
{
var vFullFileName = HostingEnvironment.MapPath("~/App_Data/Files/");
var files = uploadedfileRepository.AllIncluding();
string filename = (from f in files
select f.FileName).First();
return File(Path.Combine(vFullFileName, filename), "application/csv", filename);
}
我把断点和文件指向了正确的目录,但是为什么还是给我File not found异常呢?
在我看来,这就是我所拥有的
<td>
@Html.ActionLink("Download", "Download", new { id = item.FileName})
</td