Download file that stored in sql server
Hi,
I have tried to implement file download option. I can download file which is stored in any folder. Code is...
string filepath = Request.Params["file"].ToString();
string filename = Path.GetFileName(filepath);
Response.Clear();
Response.ContentType = "image/gif";
Response.AddHeader("Content-Disposition", "attachment; filename=" + filename);
Response.Flush();
Response.WriteFile(filepath);
This code is working fine. Now I want to store the file in database table. User can download file from the database. How can I do this? The file may be a .txt, .doc, .xls, .jpg or .gif.
__________________
Angshujit
|