Take a Byte array and sends it to the HTTP Response stream. sf.getAttachment(fa); is an externation function that gets the bytes from SQL server
byte[] bData = sf.getAttachment(fa);
Response.Clear();
Response.Buffer = true;
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "application/log";
Response.AddHeader("Content-Disposition", "attachment; filename=" + fa.fileName);
Response.AddHeader("Content-Length", fa.contentLength.ToString());
Response.BinaryWrite(bData);
Response.Flush();
Response.End();