根据路径下载
public IActionResult DownloadFile(){
//string filePath = AppDomain.CurrentDomain.BaseDirectory.Replace("\\", "/") + model.Path;//"Excel/123.zip";//以字符流的形式下载文件 string filePath = Directory.GetCurrentDirectory().Replace("\\", "/") + "/wwwroot/modeulFile/模板下载.xls";var addrUrl = filePath;var stream = System.IO.File.OpenRead(addrUrl);string fileExt = ".xls";//GetFileExt(file);//获取文件的ContentTypevar provider = new FileExtensionContentTypeProvider();var memi = provider.Mappings[fileExt];return File(stream, memi, Path.GetFileName("模板下载.xls"));}