I would retrieve the binary data from the database and save it on the disk. Next make it accessible to the browser by sending to the client the simple javascript:
Code:
<a href="\\mypath\\myfile.pdf" > Click here to see ...</a>
<a href="\\mypath\\myfile.doc" > Click here to see ...</a>
<a href="\\mypath\\myfile.txt" > Click here to see ...</a>
Or,in the .aspx page do the same using a LinkButton or LinkLabel if the client is a Windows application.
To retrive the binary from SQL :
[/code]
SqlConnection conn=new SqlConnection(sConnectionString);
SqlCommand cmd = new SqlCommand("select binary FROM FileData);
conn.Open();
SqlDataAdapter da=new SqlDataAdapter();
DataSet ds = new DataSet();
da.Fill(ds);
MemoryStream ms = new MemoryStream();
Bitmap bmp = null;
Byte [] bImg=null;
//int iOffset = 78; // offset fro DB images
for (iRowCount=0;i<ds.Tables[0].Rows.Count;iRowCount++)
{
bImg = ds.Tables[0].Rows[iRowCount].Item[0];
ms.Write(bImg,bImg.Length -/*iOffset*/);
bmp = new Bitmap(ms);
string sFileName= "File"+ds.Tables[0].Rows[iRowCount]["id"].ToString()+"."+ds.Tables[0].Rows[iRowCount]["FileType"];
bmp.Save(sFileName);
}
conn.Close();
//..
[/code]
There are also other ways.
obislavu