文件流形式写入客户端

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();

你可能感兴趣的:(客户端)