Auto download file using web control

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cypherkro
    New Member
    • Jul 2007
    • 2

    Auto download file using web control

    Hi

    I have a requirement to automatically download a file using a WebBrowser control without having the "Download File" pop up windows display.
    I cannot use Webclient!!

    I am using VS2005, .net2 and the application is a windows application.

    Does anyone have a solution to automatically downloading the file from a WebBrowser control.

    Thanks in Advance
    Kevin
  • radcaesar
    Recognized Expert Contributor
    • Sep 2006
    • 759

    #2
    For this u need to use the ie api to override that behavior
    Have a look on this,
    http://www.codeproject .com/shell/iesaveas.asp

    Comment

    • Plater
      Recognized Expert Expert
      • Apr 2007
      • 7872

      #3
      You are using the webbrowser object in your project (to view webpages) and when someone clicks the link, you want your program to download that file without asking?

      Is there any event that is thrown when you click a link? If so, you could use the HTTPWebRequest object to download the item.

      Comment

      • cypherkro
        New Member
        • Jul 2007
        • 2

        #4
        Thanks for the reply guys.
        However, I cannot download the file with any other means except the WebBrowser, this is because the files to download are in an HTTPS site using sessions, so, if I try to download with, lets webclient or webrequest, the website returns a "Session Invalid" error, and to code to use webrequest against this website is not viable.

        Is there any way to surpress this dialog box? I am using C#

        Comment

        Working...