Solved

Intercepting the "Save As..." dialog box from WebBrowser control....

Posted on 2002-07-17
3
191 Views
Last Modified: 2010-05-02
You know how when you navigate your webbrowser control to a downloadable file, the Save As dialog comes up?  Well here's what I need to do:

Instead of the save as dialog, I want the file to automatically be downloaded to a location that I specify in code.  OR the webbrowser can download the file and return the BYTES() to me in the code, and then I will write them out to a file.

So NO Save As dialog, everything will be handled in the code!

Please let me know if this is unclear!
Thanks,
Josh
0
Comment
Question by:jsm11482
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
AlonHirsch earned 75 total points
ID: 7159559
Hi,

This has been tried before with no luck.
The only way I can suggest that you overcome this is as follows :
Create a VB project that handles the entire HTTP protocol for you. You will then be responsible for the actual download and not the web browser.
AFAIK there is no way tooverride this functionality of IE using VB.

HTH,
Alon
0
 

Author Comment

by:jsm11482
ID: 7160482
Ok, that sucks, but here's what I did to get around it:

1) Set the WebBrowser to the web page that has a link to a downloadable file.

2) Get the source code from the WebBrowser
       strCode=Browser.Document.documentElement.innerhtml

3) Parse strCode for any HREF links.

4) Find the appropriate links that you want to download.

5) Use a WinInet control to get the file:
       Inet.OpenURL(Trim(strRemotePath), icByteArray)

6) Save the bytData array to a file!

Maybe this seudo-code will be useful to someone!

Thanks,
Josh
0
 

Author Comment

by:jsm11482
ID: 7160483
Too bad that it can't be done with ease, but I thank you for your answer!
-Josh
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question