retrive the file from database.
-
uploading the file to the database is working but i can't able to retrive the data from the database can any one give me suggetion how to retrive the data srinivas -- modified at 6:33 Friday 19th May, 2006
-
uploading the file to the database is working but i can't able to retrive the data from the database can any one give me suggetion how to retrive the data srinivas -- modified at 6:33 Friday 19th May, 2006
You can cast the data to a byte array and then either save it or stream it to the browser. For example:
byte[] data = _data.Tables["MyTable"].Rows[X]["MyColumn"]; Response.Clear(); Response.ContentType = [Mime Type, e.g. application/pdf] Response.AddHeader("Content-Length", data.LongLength.ToString()); Response.AddHeader("Content-Disposition", String.Format("attachment; filename={0};", "MyFile.pdf")); Response.BinaryWrite(data); Response.End();
Jim Conigliaro jconigliaro@ieee.org -- modified at 7:51 Friday 19th May, 2006