string strFileName ="avatar_img.jpg";//客户端保存的文件名
string path = TextBox1.Text;
//以字符流的形式下载文件
byte[] bytes = Signature.SelectImage(int.Parse(path));
System.IO.MemoryStream ms = new System.IO.MemoryStream(bytes);
ms.Read(bytes, 0, bytes.Length);
ms.Close();
Response.ContentType = "application/octet-stream";
//通知浏览器下载文件而不是打开
Response.AddHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode(strFileName, Encoding.UTF8));
Response.BinaryWrite(bytes);
Response.Flush();
Response.End()
string path = TextBox1.Text;
//以字符流的形式下载文件
byte[] bytes = Signature.SelectImage(int.Parse(path));
System.IO.MemoryStream ms = new System.IO.MemoryStream(bytes);
ms.Read(bytes, 0, bytes.Length);
ms.Close();
Response.ContentType = "application/octet-stream";
//通知浏览器下载文件而不是打开
Response.AddHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode(strFileName, Encoding.UTF8));
Response.BinaryWrite(bytes);
Response.Flush();
Response.End()