MS Web Browser + .NET - File download dialog problem.

  • Thread starter Thread starter Uncle_Bob
  • Start date Start date
U

Uncle_Bob

Hello all!

I'm writing a simple C# application, that should day by day open a
particular web site and download a text file (new file is generated by
the server daily).

I'm using Microsoft Web Browser ActiveX, and I cannot simply provide
the file URL in my app, because of:

1) First, I should provide credentials to enter the site
2) I should execute a script to generate a page containing list of
files
3) I should parse a page to find a link to the particular file (file
URL)

So far I succeeded with all these steps and this is what I'm actually
having problem with:

When I execute Navigate method on a file url, the file download dialog
appears. I don't need the dialog, but unfortunately don't know how to
skip it, just download the file and save it to some folder.

For now I'm using another approach - fortunately the web site provides
the way to view the content of file inside a web page, so I'm loading
the page an grabbing its contents... But I don't like this anyway.

Any help appreciated.
 
I'm not sure it could be done this way, as there's an authentication
procedure I mentioned above. If I would ask server for the file url
directly, it will come up with HTTP 403 and redirect me to the login
page.
 
Back
Top