Results 1 to 3 of 3

Thread: how to disable the file download popup window?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2004
    Posts
    362

    how to disable the file download popup window?

    I'm using a webbrowser in the program. it will login a site, then get a special link which is a csv file on the site. then I need download the file. since the site needs login and uses https, so, I use webbrowser.

    now, I can login, but when I click the file link, it will pop a message box and ask me to save/open it.

    is it possible to disable this popup window and save the file to local directly?


    thanks

  2. #2
    Master Of Orion ForumAccount's Avatar
    Join Date
    Jan 2009
    Location
    Canada
    Posts
    2,802

    Re: how to disable the file download popup window?

    You should be able to use the WebClient class, and the DownloadFile method of it:

    vb.net Code:
    1. Using wc = New Net.WebClient()
    2.     wc.Credentials = '//supply credentials
    3.     wc.DownloadFile("address", "fileName")
    4. End Using

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2004
    Posts
    362

    Re: how to disable the file download popup window?

    unfortunately, I can not use webclient. because I need login the site to get the file url, the site is a https, and it seems the site also uses a cookie. so, if I just send a get request, it will fail. I have to use program login, then from webbrowser to load the url, but it will pop the file "open/save as" message box.

    can I get around this and save the file directly?


    thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width