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 put a progressbar while downloading a file IdFTP ??

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





PostPosted: Mon Nov 15, 2004 2:37 pm    Post subject: how to put a progressbar while downloading a file IdFTP ?? Reply with 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.
thanks


Back to top
J. Peter Mugaas
Guest





PostPosted: Mon Nov 15, 2004 3:02 pm    Post subject: Re: how to put a progressbar while downloading a file IdFTP Reply with quote



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





PostPosted: Mon Nov 15, 2004 7:14 pm    Post subject: Re: how to put a progressbar while downloading a file IdFTP Reply with quote




"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





PostPosted: Tue Nov 16, 2004 2:13 pm    Post subject: Re: how to put a progressbar while downloading a file IdFTP Reply with 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


Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Tue Nov 16, 2004 5:42 pm    Post subject: Re: how to put a progressbar while downloading a file IdFTP Reply with quote


"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
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.