I need this:
I click a href such as http://localhost/down.aspx?nid=123 and in fact it
points to a file named 123.zip, I want to
get the file name "123.zip" before the downloading begins.
I need this:
I click a href such as http://localhost/down.aspx?nid=123 and in fact it
points to a file named 123.zip, I want to
get the file name "123.zip" before the downloading begins.
The browser control has an interface named DWebBrowser2. One of the events
on that interface is BeforeNavigate2 which fires just before the control
moves to a new URL. I _think_ (but I am not sure) that a Browser Helper
Object could be used to get access to this interface in IE so that you could
track IE's movements. Alternatively, you could host the browser control in
your own application.
Dino Esposito has written in MSJ or MIND or MSDN magazine on the topic. You
might want to search the web.
Now I can catch the event "DWebBrowserEvent2->FileDownLoad", but I don't
know how can I catch get file name from the website.
What function or class should I use to get the name?For example http://localhost/vc6.rar, how can I get it?
I don't know for sure. I suggest you do some experimenting. I would expect
that the sequence of events might be something like
BeforeNavigate2 // includes URL
FileDownload
DownloadBegin
DownloadComplete
NavigateComplete2
but that's just speculation on my part.
Regards,
Will
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.