62,266
社区成员
发帖
与我相关
我的任务
分享
Response.Clear();
Response.Buffer = false;
FileInfo fi = new FileInfo(physicalPath);
if (fi.Exists)
{
‘这个 attachment 就是告诉浏览器 当附件文件下载,不真接打开 Response.AddHeader("Content-Disposition", "attachment;filename=" + fileName); Response.AppendHeader("Content-Length", fi.Length.ToString());
Response.WriteFile(physicalPath);
}
this.Response.Flush();
Response.End();