MVC下载文档

时间:2022-08-24 20:36:37
         public FileStreamResult DownFile(string content,string name)
{
ProInterface.ISubject ems = new ProServer.Service();
string fileName = ems.DownWord(content.Replace("newline", "\r\n"), name).ToString(); //ProInterface.ISubject ems = new ProServer.Service();
//object fileName = ems.DownWord(Fun.UserKey, ref err, ent);
string path = AppDomain.CurrentDomain.BaseDirectory + ("UpFiles\\") + fileName;
return File(new FileStream(path, FileMode.Open, System.IO.FileAccess.Read, FileShare.ReadWrite), "image/jpeg jpeg jpg jpe", fileName);
}

MVC下载文档

FileStreamResult 类型