Solved

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

Posted on 2002-07-17
3
202 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses
Course of the Month10 days, 8 hours left to enroll

628 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