Click here to Skip to main content
15,072,391 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I am developing a web application. In this application a user can download a file stored in Sql Server. How i do it is that i show the list of files in a datagrid. When user clicks on a corresponding download link in gridview the file is read from database and written in a temporary file on web server disk. Then i write the below code to download the file on client side.

Response.ContentType = "application/pdf";
  Response.WriteFile("tempfile.pdf");
  Response.Flush();

All works fine and the pdf file gets opened in browser on client side. But what i want to do is that the pdf file should not be opened in browser, i want to show a save file dialog option on the client side so that client can save file in his disk without being opened in web browser.

Thanks in advance for any response.
Posted
Updated 26-Nov-10 20:09pm
v2

1 solution

This may help you:

http://aspalliance.com/259[^]
   
Comments
irfankhan200 27-Nov-10 3:22am
   
Thanks that realy worked.
Ankur\m/ 27-Nov-10 4:49am
   
4! I would have given you a 5 if you would have given a meaningful text to the link.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900