DataTable Data=Components.DocumentSystem.FileDataByID(int.Parse(NV.GetValues("ID")[0]));//读取数据到DataTable中。
DataRow Row=Data.Rows[0];
Response.Clear();
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment;FileName="+HttpUtility.UrlEncode(Row["Title"].ToString(),System.Text.Encoding.UTF8)+"."+Row["ContentType"].ToString());
Response.BinaryWrite((byte[])Row["FileData"]);//写出流!
Response.End();
转载于:https://www.cnblogs.com/gaohades/archive/2008/05/16/1200061.html