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: | "Remy Lebeau (TeamB)" (no.spam@no.spam.com) |
| Date: | Mon, 8 May 2006 12:27:14 |
"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