0

I have url like this

http://domainname.com/view/downloadfile?uname='ddd'&id=4

if we type the above url (not exactly the same ) in browser address bar it prompts open/save file dialog

my requirement is in button click without open/save dialog i need to download the file to my local disk location

Actually am working with webbrowser control .button is outside the webbrowser control

Suresh
  • 47
  • 2
  • 8
  • Do you actually need the web-browser? Because you can download the file without it. Do you need your download code to somehow incorporate the web-browser? – Jason Mar 16 '12 at 08:59
  • actually there is a link for download in one site. what my requirement is without clicking that link by clicking a button outside the webbrowser it should be downloaded – Suresh Mar 16 '12 at 11:06

1 Answers1

1

You could use the WebClient.DownloadFile method. Or if you don't want to save the file on the disk but manipulate it in memory you could use the WebClient.DownloadData method.

Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928