Board index » delphi » FTP Progress

FTP Progress


2005-07-25 03:06:12 PM
delphi47
I'am a problem with the FTP component (Indy 9). On event OnWorkBegin the
AWorkCountMax variable don't have value, the value is 0.
After on event OnWork work correctly.
Another question...Who I can know the filename what is transfering?
Thanks.
 
 

Re:FTP Progress

"Antonio" <XXXX@XXXXX.COM>writes
Quote
I'am a problem with the FTP component (Indy 9). On event
OnWorkBegin the AWorkCountMax variable don't have value,
the value is 0.
That happens whenever the file size is not known before the transfer begins.
Which should only happen during downloads, not uploads. The FTP protocol
has no provisions for sending the size of a file during a transfer. During
an upload, AWorkCountMax will always be valid since TIdFTP can retreive the
local file size, but during a download you must retreive the file size from
the server separately before then downloading the actual file. Some servers
support the SIZE command, which is implemented in TIdFTP's Size() method.
However, not all servers support the SIZE command, so you would have to use
List() instead to get the file size.
Quote
Who I can know the filename what is transfering?
You will have to keep track of that yourself before calling Get() or Put().
Store the filename that you request into a separate variable that the rest
of your code can access when needed.
Gambit