dowload.aspx

      HttpContext.Current.Response.Clear();
       HttpContext.Current.Response.AddHeader("Content-Type", "application/octet-stream");
       HttpContext.Current.Response.Charset = "utf-8";
       HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(file.Name, System.Text.Encoding.UTF8));
       HttpContext.Current.Response.AddHeader("Content-Length", file.Length.ToString());
       HttpContext.Current.Response.WriteFile(file.FullName);
       HttpContext.Current.Response.Flush();
       HttpContext.Current.Response.Clear();
       HttpContext.Current.Response.End();
原文地址:https://www.cnblogs.com/zymsdn/p/2044778.html