Jul 29, 2013, 3:11 AM
Downloading file after File Upload
Hi Friends,
New to this forum, need some help regarding file download.
I am using file file upload to upload file and save it to my db.
Now I want to retreive my saved file.
I want to show a hyperlink as when the user clicks on the hyperlink it should open the file Open/Save dialog.
I am using the following code:
Response.Clear();
Response.Buffer = true;
Response.AddHeader("content-disposition", "attachment;filename=" + fileName + fileExtn);
Response.ContentType = "Application/x-msexcel";
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.No Cache);
Response.BinaryWrite(byteArray);
Response.End();
When I use the above code in a EXT:BUTTON it works fine and opens the Save dialog.
But the same code when used in EXT:Hyperlink Or LinkButton open the file contents in the EXT.NET frame.
How can I use hyperlink to open the save dialog.
Any suggestions please.
Thanks
New to this forum, need some help regarding file download.
I am using file file upload to upload file and save it to my db.
Now I want to retreive my saved file.
I want to show a hyperlink as when the user clicks on the hyperlink it should open the file Open/Save dialog.
I am using the following code:
Response.Clear();
Response.Buffer = true;
Response.AddHeader("content-disposition", "attachment;filename=" + fileName + fileExtn);
Response.ContentType = "Application/x-msexcel";
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.No Cache);
Response.BinaryWrite(byteArray);
Response.End();
When I use the above code in a EXT:BUTTON it works fine and opens the Save dialog.
But the same code when used in EXT:Hyperlink Or LinkButton open the file contents in the EXT.NET frame.
How can I use hyperlink to open the save dialog.
Any suggestions please.
Thanks