Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

trap a download in ie4 to own application.

Posted on 1998-10-11
8
Medium Priority
?
210 Views
Last Modified: 2010-04-06
I would like to know how to trap the download of a file from within my own application and handle the download, i also need to obtain the URL from which they clicked the file, the url that the file is coming from.  If you could post any information, URLS for information, sample source code or anything, it would be appreciated.

0
Comment
Question by:brunner
[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
8 Comments
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1342539
You could set up a helper application that was associated with the appropriate file type. Then ie4 should do it automatically...

0
 
LVL 4

Expert Comment

by:dwwang
ID: 1342540
I think it is something concerning registry.

Have you ever used GetRight? It can set Netscape/IE to use it as default downloader, when you enter a url in netscpe, it is first transfered to GetRight. (So sometimes if you imroperly remove GetRight, Netscape will refuse to respond for any url.)

I had serached for registry for "getright" and found that it add something to Netscape's registry information. So you can have a try and find what may help.
0
 

Expert Comment

by:john_m
ID: 1342541
To capture the selection of a file to download you will have to write an application that registers itself with IE's COM event interface.

IE supports the DWebBrowserEvents1 and DWebBrowserEvents2 interfaces, both of which have the methods DownloadBegin and DownloadComplete.

I would imagine that you will have to create an event sink in your application, wrap the outgoing interface from IE and register your application in the outgoing interface's ConnectionPoint.

With this done you should be able to receive notification of download events. I don't have time to try this at the moment, but I shall try this evening.


0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 1

Expert Comment

by:zac
ID: 1342542
The solution is a registry addition that tells IE what to do with certain URL types, for instance telnet://  with open telnet etc.

By changing or adding values you can cause IE to shell your application - you could even handle http:// yourself rather than IE.......

The entries are stored under HKEY_CLASSES_ROOT in the registry, surprisingly http represents what to do with http:// urls etc....

So if you wanted a URL type called fred you could create a new key called fred etc.....  The full definition of the registry key is as follows....

[HKEY_CLASSES_ROOT]    
[fred]
        (Default) = "URL:Fred Protocol"
        URL Protocol = ""
        [DefaultIcon]
            (Default) = "fred.exe"
        [shell]
            [open]
                [command]
                    (Default) = "c:\<yourpath>\fred.exe %1"

The standard compliment of commands are supported under the shell\open entry (ie you can use other verbs other than command).

If you want further information let me know and I will dig up the MSDN reference for this and post it here....

Good Luck

Zac
0
 

Author Comment

by:brunner
ID: 1342543
Zac,

Thanks for that information however for 200 points I am after a little more of an answer and some code as well..

What you have written may technically be correct however it does not help me enough to achieve the result that i need. I don't want to take control of all downloads, only file downloads and only when my application is loaded. There may be some sort of WM_ message that needs to be called or something..

0
 

Author Comment

by:brunner
ID: 1342544
Adjusted points to 250
0
 

Accepted Solution

by:
uuuppz earned 500 total points
ID: 1342545
As far as I know the answer is much easier than Zac is saying. I think the train of thought  john_m was following sounded promising. Just add the MS Common web browser control to one of your packages (not exactly difficult, Delphi will do it for you very efficiently), then put one on your form. Then catch the begin download event. Check to see if the download is a file, if so tell the component to cancel the download and handle it your self.


0
 

Expert Comment

by:john_m
ID: 1342546
Thanks for concluding my thoughts uuuppz - just didn't have time to finish it off myself... Cheers

John.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

604 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