public void ExportToExcelByName(string fileNames)
{
//string filePath = "Z:\\BSS\\" + fileNames;
//string mapExcelFilesPath =
ConfigurationManager.RefreshSection("AppSettings");
string mapExcelFilesPath = ConfigurationManager.AppSettings["MapExcelFilesPath"];
string filePath = mapExcelFilesPath + fileNames;
//string filePath = mapExcelFilesPath + fileNames;
try
{
//string DownloadFileName = "~/uploads/" + e.CommandArgument.ToString();//文件路径
//string filepath = Server.MapPath(DownloadFileName);
string filename = Path.GetFileName(filePath);
FileInfo file = new FileInfo(filePath);
Response.Clear();
Response.ContentType = "application/octet-stream";
R
MVC Controller 下载指定路径的文件
最新推荐文章于 2022-02-22 15:17:06 发布