| View previous topic :: View next topic |
| Author |
Message |
Boris Chirino Fdez Guest
|
Posted: Mon Nov 15, 2004 2:37 pm Post subject: how to put a progressbar while downloading a file IdFTP ?? |
|
|
I want to put a progressbar while downloading a file, the help says try with
a Onwork begin and Onwork but in facts does not any thing, if anybody done
this before please help me.
thanks
|
|
| Back to top |
|
 |
J. Peter Mugaas Guest
|
Posted: Mon Nov 15, 2004 3:02 pm Post subject: Re: how to put a progressbar while downloading a file IdFTP |
|
|
On Mon, 15 Nov 2004 09:37:03 -0500, Boris Chirino Fdez wrote:
| Quote: | I want to put a progressbar while downloading a file, the help says try with
a Onwork begin and Onwork but in facts does not any thing, if anybody done
this before please help me.
|
The FTP Protocol does not provide the size of the file being transferred
while its transferring the file. You have to request the size before you
request the file itself. You use the TIdFTP.Size method to get the size of
a filename. That may not always work though and if that happens, you
should simply report the number of bytes that have been downloaded using
the WorkCount value in the OnWork Event. That's about the best you can do.
I've heard of people using the directory listing to get the file size but
that will NOT work as you would expect because some servers will only
provide estimated file sizes or sometimes, a server will not report any
size at all.
--
J. Peter Mugaas - Indy Pit Crew
Internet Direct (Indy) Website - http://www.indyproject.org/
Personal Home Page - http://www.wvnet.edu/~oma00215
If I want to do business with you, I will contact you. Otherwise, do not
contact me.
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Mon Nov 15, 2004 7:14 pm Post subject: Re: how to put a progressbar while downloading a file IdFTP |
|
|
"Boris Chirino Fdez" <boris (AT) epiaonce (DOT) cu> wrote
| Quote: | I want to put a progressbar while downloading a file
|
Please be more specific. How are you downloading the file to begin with?
Which protocol are you using? FTP? HTTP? Other?
| Quote: | the help says try with a Onwork begin and Onwork
but in facts does not any thing
|
Please be more specific. Just saying it doesn't work says nothing at all
about the actual problem you are having with it. Always provide details.
Gambit
|
|
| Back to top |
|
 |
Boris Chirino Fdez Guest
|
Posted: Tue Nov 16, 2004 2:13 pm Post subject: Re: how to put a progressbar while downloading a file IdFTP |
|
|
The problem it's that actuali i put a progressbar and, in the events onWork
wrote
ProgressBar1.Position := AWorkCount; and the progressbar does not show the
progress of downloading
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Tue Nov 16, 2004 5:42 pm Post subject: Re: how to put a progressbar while downloading a file IdFTP |
|
|
"Boris Chirino Fdez" <boris (AT) epiaonce (DOT) cu> wrote
| Quote: | The problem it's that actuali i put a progressbar and, in the
events onWork wrote ProgressBar1.Position := AWorkCount;
and the progressbar does not show the progress of downloading
|
Did you set the ProgressBar's Max property ahead of time?
Are you using the component in the main thread? If so, then you are
probably blocking the main message queu from processing new messages. Did
you try calling the ProgressBar's Update() method after setting its
Position? If that doesn't work, then try adding a TIdAntiFreeze onto the
form.
Gambit
|
|
| Back to top |
|
 |
|