Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Feb : ICS TFtpClient retrieve file size

www.cryer.info
Managed Newsgroup Archive

ICS TFtpClient retrieve file size

Subject:ICS TFtpClient retrieve file size
Posted by:"Michael Fritz" (spam_athome@yahoo.de)
Date:Thu, 15 Feb 2007 10:18:20

Hi,

I'm using the BasFtp1 demo of ICS to test downloading a file from an FTP
server. I changed this demo (at least a tried to) to retrieve the file size
before downloading to feed a progress bar.

I've changed the RequestDone event the following way:
[..]
    ftpTypeSetAsync:
                  begin
                      FtpClient1.HostFileName  := FFileName;
                      FtpClient1.LocalFileName := FLocalFileName;
                      FtpClient1.SizeAsync;    << here
//                      FtpClient1.GetAsync;    << here
                  end;
    ftpSizeAsync, ftpFileSizeAsync  :        << new
                  begin
                    ProgressBar1.Max := FtpClient1.SizeResult;
                    FtpClient1.GetAsync;
                  end;
    ftpGetAsync:  begin
                      FSuccess := (FtpClient1.StatusCode = 226);
                      FtpClient1.QuitAsync;
                  end;

When SizeAsync is executed the status/error code I get is 550, access
denied. I assume that authentication was correct, since all previous status
messages told me so.

So what's wrong here? Or better how would you determine the file size
before downloading?
--
cu,
Michael

Replies:

www.cryer.info
Managed Newsgroup Archive