导出文件:
                string filePath = Server.UrlDecode(filePath);
                if (File.Exists(filePath))
                {
                    FileInfo fi = new FileInfo(filePath);
                    Response.Clear();
                    Response.ClearHeaders();
                    Response.Buffer = false;
                    Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(Path.GetFileName(filePath), System.Text.Encoding.UTF8));
                    Response.AppendHeader("Content-Length", fi.Length.ToString());
                    Response.ContentType = "application/octet-stream";
                    Response.WriteFile(filePath);
                    Response.Flush();
                    Response.End();
                }

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-16
  • 2021-09-29
  • 2021-07-22
  • 2021-09-01
  • 2022-12-23
猜你喜欢
  • 2021-11-28
  • 2021-11-08
  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
  • 2021-06-16
  • 2021-05-21
相关资源
相似解决方案