 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Bo Berglund Guest
|
Posted: Tue Feb 24, 2004 10:42 pm Post subject: How to show progress duting an IdHTTPD.GET operation? |
|
|
I am going to download a rather big zip file using IdHTTPD.Get. The
info lands in a TMemoryStream object that is later saved to file.
But how can I:
1) Display the transfer progress?
2) Find out before starting how big a file is going to be transferred?
Comparing to IE, if I rightclick/save a zip file link the dialog will
show the size of the zip and also show the progress of the transfer.
How can this be done with IdHTTPD transfers?
Uisng Delphi6 and Delphi7
/Bo
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Tue Feb 24, 2004 10:54 pm Post subject: Re: How to show progress duting an IdHTTPD.GET operation? |
|
|
"Bo Berglund" <bo.berglund (AT) telia (DOT) com> wrote
| Quote: | 1) Display the transfer progress?
|
Use the TIdHTTP's OnWork... events. They are triggered during the transfer.
| Quote: | 2) Find out before starting how big a file is going to be transferred?
|
You need to call Head() before you call Get(). It will return the headers
for the file without actually downloading the file itself. The headers
include the size, filename, content type, etc. The headers are stored in
the TIdHTTP's Response property, the same as they are for Get() itself.
Gambit
|
|
| Back to top |
|
 |
Bo Berglund Guest
|
Posted: Tue Feb 24, 2004 11:16 pm Post subject: Re: How to show progress duting an IdHTTPD.GET operation? |
|
|
On Tue, 24 Feb 2004 14:54:50 -0800, "Remy Lebeau (TeamB)"
<gambit47.no.spam (AT) no (DOT) spam.yahoo.com> wrote:
| Quote: | 2) Find out before starting how big a file is going to be transferred?
You need to call Head() before you call Get(). It will return the headers
for the file without actually downloading the file itself. The headers
include the size, filename, content type, etc. The headers are stored in
the TIdHTTP's Response property, the same as they are for Get() itself.
Looks like the IdHTTP.WorkBegin supplies the size too, as |
AWorkCountMax parameter.
I used this and it seems OK.
Bo
|
|
| 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
|
|