🐛 修复导出偶现出错

This commit is contained in:
不做码农 2023-05-31 18:54:20 +08:00
parent 0842d1b4ec
commit 3f66fc9e60

View File

@ -61,6 +61,7 @@ namespace ZR.Admin.WebApi.Controllers
//IWebHostEnvironment webHostEnvironment = (IWebHostEnvironment)App.ServiceProvider.GetService(typeof(IWebHostEnvironment));
//string fileDir = Path.Combine(webHostEnvironment.WebRootPath, path, fileName);
Response.Headers.Add("Access-Control-Expose-Headers", "Content-Disposition");
var stream = Io.File.OpenRead(path); //创建文件流
return File(stream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", HttpUtility.UrlEncode(fileName));
}