文档下载报路径超长错误
System.IO.FileInfo fileInfo = new System.IO.FileInfo(fileroot);如果文档路径fileroot的值超长(超过248)则代码报错,请问这个问题改怎么解决,谢谢!
MVC后台代码:
public ActionResult DownLoadFile(string fileroot)
{
System.IO.FileInfo fileInfo = new System.IO.FileInfo(fileroot);
return File(fileInfo.FullName, "unknown", fileInfo.Name);
}