62,050
社区成员
发帖
与我相关
我的任务
分享
FileInfo fi = new FileInfo(Server.MapPath("123.pdf"));
if (fi.Exists)
{
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=123.pdf");
Response.AddHeader("Content-Length", fi.Length.ToString());
Response.ContentType = "application/pdf";
Response.Filter.Close();
Response.WriteFile(fi.FullName);
HttpContext.Current.ApplicationInstance.CompleteRequest();
}
Response.ContentType = "application/pdf";
Response.Clear();
Response.TransmitFile(Server.MapPath("123.pdf"));
Response.End();