28,409
社区成员




public static void DownLoadPdf2(string pdfpath, string filename)
{
HttpResponse _Response = HttpContext.Current.Response;
FileInfo fileInfo = new FileInfo(pdfpath);
_Response.Clear();
_Response.ClearHeaders();
_Response.Buffer = false;
_Response.ContentType = "application/octet-stream";
_Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(filename,
System.Text.Encoding.UTF8));
_Response.AppendHeader("Content-Length", fileInfo.Length.ToString());
_Response.TransmitFile(fileInfo.FullName);
_Response.Flush();
_Response.End();
}