Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 May : Re: Progress Bar for an FTP Transfer
| Subject: | Re: Progress Bar for an FTP Transfer |
| Posted by: | "Barry Wood" (bar..@amss.uk.com) |
| Date: | Tue, 9 May 2006 09:32:14 |
Remy
The penny has just dropped - the OnWork returns values whilst the put is
ongoing! How the blind can't see. Part of problem is there is so little
description of the events - none in Delphi, not that well documented on the
Indy site (that's my excuse anyway).
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message
news:445f9c1c$1@newsgroups.borland.com...
>
> "Barry Wood" <Barry@AMSS.uk.com> wrote in message
> news:445ef7a3$1@newsgroups.borland.com...
>
>> Yes, Indy has those events. I'm not unclear how I go about getting
>> the info from them.
>
> What exactly is unclear about them?
>
>> I have a 'put' to transfer the file and I know the size: how do I get
>> the 'progress' points?
>
> When you upload a file, the OnWorkBegin event will tell you the size of
> the
> file being uploaded. Set your progress bar's Max property to that value.
> Then the OnWork event is triggered periodically during the transfer to
> tell
> you the number of bytes that have been triggered so far. Set your
> progress
> bar's Position property to that value. When the OnWorkEnd event is
> triggered, the transfer has finished, so reset your progress bar as
> needed.
>
>> Would I need a separate thread running to get the updates from OnWork?
>
> No. They are triggered in the same thread that is calling Put().
>
>
> Gambit
none