 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Hon Yuen, Ng Guest
|
Posted: Thu Nov 20, 2003 8:39 am Post subject: Re: Problem download URL of this kind :( |
|
|
Sorry, guys, I posted the initial URL wrongly... It should be
http://dopewars.cjb.net/dopewars.zip
Thanks in advance again.
From,
Hon Yuen, Ng
|
|
| Back to top |
|
 |
eshipman Guest
|
Posted: Thu Nov 20, 2003 3:45 pm Post subject: Re: Problem download URL of this kind :( |
|
|
In article <3fbc7ced (AT) newsgroups (DOT) borland.com>, [email]hyng (AT) tm (DOT) net.my[/email] says...
| Quote: | meta http-equiv="refresh" content="0;
url=http://pdaguy.com/dopewars/dopewars.zip"
|
Use the OnRedirect event to get the URL of the refresh in the dest
parameter and then go get the file from there.
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Thu Nov 20, 2003 6:50 pm Post subject: Re: Problem download URL of this kind :( |
|
|
"eshipman" <eshipman@yahoo!!!.com> wrote
| Quote: | Use the OnRedirect event to get the URL of the refresh
in the dest parameter and then go get the file from there.
|
That will not work, because the OnRedirect event will *not* be triggered i
this case. The server is not sending back a true HTTP redirect request,
which is required to triggered the OnRedirect event. It is sending back
actual HTML, which in turn includes a META refresh tag. META refreshes are
not HTTP redirects, thus will not trigger the OnRedirect event. They are
strictly a client-side browser feature. It is the browser's responsibility
to parse the HTML, recognize the META refresh tag, and redirect itself to
the specified address accordingly. Hon Yuen will have to do the same thing
in his code - download the HTML, parse it, recognize the META tag, and
perform another Get() using the new URL.
Gambit
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Thu Nov 20, 2003 6:50 pm Post subject: Re: Problem download URL of this kind :( |
|
|
"Hon Yuen, Ng" <hyng (AT) tm (DOT) net.my> wrote
| Quote: | Anybody know how can i download file of this kind?
|
See my reply to eshipman.
Gambit
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Thu Nov 20, 2003 6:52 pm Post subject: Re: Problem download URL of this kind :( |
|
|
"Remy Lebeau (TeamB)" <gambit47.no.spam (AT) no (DOT) spam.yahoo.com> wrote
| Quote: | It is sending back actual HTML, which in turn includes a META refresh tag.
|
Actually, the HTML is also using a frameset to trigger the download for
newer browsers, and using the META only for older browsers that don't
support frames. So you'd probably want to support frames as well in your
HTML parsing.
Gambit
|
|
| Back to top |
|
 |
Markku Uttula Guest
|
Posted: Thu Nov 20, 2003 9:19 pm Post subject: Re: Problem download URL of this kind :( |
|
|
Hon Yuen, Ng wrote:
You need to parse the response yourself to actually find out where the
document is located at. CJB offer redirection services (even though
none of their services as far as I've seen actually is a redirection)
only, nothing resides on their own servers.
--
Markku Uttula
|
|
| Back to top |
|
 |
Hon Yuen, Ng Guest
|
Posted: Sat Nov 22, 2003 3:51 am Post subject: Re: Problem download URL of this kind :( |
|
|
Thanks for the reply...
I think I somehow understand what you meant, but how can i determine if the
incoming stream is a HTML file? Do i have to wait until the file is total
downloaded? Or do i open the data capture in the stream (TFileStream in my
case) and parse the stream?
I totally dont have any idea for this. Any input is deeply appreciated.
Thanks in advance.
From,
Hon Yuen, Ng
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Sat Nov 22, 2003 10:44 pm Post subject: Re: Problem download URL of this kind :( |
|
|
"Hon Yuen, Ng" <hyng (AT) tm (DOT) net.my> wrote
| Quote: | how can i determine if the incoming stream is a HTML file?
|
See if the Response.ContentType has a value, such as "text/html".
Otherwise, you'll just have to analyze the actual response content directly.
| Quote: | Do i have to wait until the file is total downloaded?
|
Get() won't return until that happens anyway.
Gambit
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|