<pre> private void DocumentFile() { Document document = new Document(); DataTable dTable = document.GetDocuments(); if (dTable.Rows.Count > 0) { foreach (DataRow row in dTable.Rows) { string contentType = dTable.Rows[0]["ContentType"].ToString(); string extension = dTable.Rows[0]["Extension"].ToString(); byte[] content = (byte[])dTable.Rows[0]["Content"]; Response.Clear(); MemoryStream ms = new MemoryStream(content); Response.ContentType = contentType; Response.AddHeader("Content-Disposition", "attachment; filename=\"" + "Doc" + extension + "\""); Response.Buffer = true; ms.WriteTo(Response.OutputStream); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)