点击 保存文件

1.ViewState["UpLoadFile"] = ds.Tables[0].Rows[0]["UpLoadFile"]!=System.Convert.DBNull?(byte[])ds.Tables[0].Rows[0]["UpLoadFile"]:null;

2.
                 Response.AddHeader("Connection", "Keep-Alive");
                Response.ContentType = "application/octet-stream";
                Response.AddHeader("Content-Disposition", "attachment;filename=" + ViewState["UpLoadFileName"].ToString());
                Response.OutputStream.Write((byte[])ViewState["UpLoadFile"], 0, (int)(((byte[])ViewState["UpLoadFile"]).Length));
                Response.End();
原文地址:https://www.cnblogs.com/lingxzg/p/1110202.html