🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internet.socket
3 messages
3 total messages Started by David Ayre Fri, 24 Mar 2006 15:29
Progress bar for FTP
#2546
Author: David Ayre
Date: Fri, 24 Mar 2006 15:29
11 lines
1105 bytes
Hi,

I'm using the Indy 9 IdFTP component and it is now working very
nicely. However, it would be nice to have a progress bar to show
the progress of the upload or download.
Is this possible with this component, and if so, how is it implemented?

Thanks,

David
Re: Progress bar for FTP
#2547
Author: Remy Lebeau (TeamB)
Date: Fri, 24 Mar 2006 19:49
26 lines
2037 bytes
"David Ayre" <davidcayre@ntlworld.com> wrote in message
news:44241e78$1@newsgroups.borland.com...

> I'm using the Indy 9 IdFTP component and it is now working
> very nicely. However, it would be nice to have a progress bar
> to show the progress of the upload or download.

That is what the OnWork... events are for.  The OnWorkBegin event tells you
when a transfer is beginning, and how much data is going to be transferred.
The OnWork event tells you the progress of the transfer.  The OnWorkEnd
event tells you when the transfer finishes.

Keep in mind, however, that the FTP protocol does not send the file size
during a transfer.  So when you use the Get() method to download a file from
the server, the OnWorkBegin event will not be able to tell you the size of
the file that is being transferred.  You will have to determine the file's
size before calling Get(), such as with a directory listing or with the
Size() method.

Uploading files, on the other hand, will always report the correct file size
in the OnWorkBegin event, since it uses the size of the stream that is used
for the transfer.


Gambit
Re: Progress bar for FTP
#2549
Author: David Ayre
Date: Sat, 25 Mar 2006 18:05
40 lines
2252 bytes
Thanks Remy,

That's great. These Indy components are really good when you
get to understand them.

Cheers,

David


"Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> wrote:
>
>"David Ayre" <davidcayre@ntlworld.com> wrote in message
>news:44241e78$1@newsgroups.borland.com...
>
>> I'm using the Indy 9 IdFTP component and it is now working
>> very nicely. However, it would be nice to have a progress bar
>> to show the progress of the upload or download.
>
>That is what the OnWork... events are for.  The OnWorkBegin event tells you
>when a transfer is beginning, and how much data is going to be transferred.
>The OnWork event tells you the progress of the transfer.  The OnWorkEnd
>event tells you when the transfer finishes.
>
>Keep in mind, however, that the FTP protocol does not send the file size
>during a transfer.  So when you use the Get() method to download a file from
>the server, the OnWorkBegin event will not be able to tell you the size of
>the file that is being transferred.  You will have to determine the file's
>size before calling Get(), such as with a directory listing or with the
>Size() method.
>
>Uploading files, on the other hand, will always report the correct file size
>in the OnWorkBegin event, since it uses the size of the stream that is used
>for the transfer.
>
>
>Gambit
>
>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads