我将为用户设置下载,但是当我使用此代码时:
Response.Clear();
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment; filename=" + FileName + ".pdf");
Response.WriteFile(Server.MapPath(@"Resumes\" + FileName + ".pdf"));
Response.End();
此错误将显示:
当我使用这段代码时:
string filename = FileName + ".pdf";
Response.ContentType = "application/octet-stream";
Response.AppendHeader("Content-Disposition", "attachment;filename=" + filename);
string aaa = Server.MapPath("~/Resumes/" + filename);
Response.TransmitFile(Server.MapPath("~/Resumes/" + filename));
Response.End();
此错误将显示:
当我尝试使用浏览器下载文件时,它完全下载没有任何错误,但 IDM 显示这些错误!!!
我正在使用 asp.net 4.5 和 IIS 8