BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to show progress duting an IdHTTPD.GET operation?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock
View previous topic :: View next topic  
Author Message
Bo Berglund
Guest





PostPosted: Tue Feb 24, 2004 10:42 pm    Post subject: How to show progress duting an IdHTTPD.GET operation? Reply with quote



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





PostPosted: Tue Feb 24, 2004 10:54 pm    Post subject: Re: How to show progress duting an IdHTTPD.GET operation? Reply with quote




"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





PostPosted: Tue Feb 24, 2004 11:16 pm    Post subject: Re: How to show progress duting an IdHTTPD.GET operation? Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.