Jump to content
Yuppski

SslFtpClient1: TSslFtpClient; - Get Host Directories/Files

Recommended Posts

Hi All

 

I have a test app that uses the Indy components. I'm replicating this test app using the Internet Component Suite, TSslFtpClient.

 

One of the features using the Indy components is to get a complete list of the Host Directories/Files:-

 

procedure TfrmMain.GetFolderInventory;
var
  DirList : TStringList;
begin
  {$REGION 'Connected?'}
  if (myFTP.Connected) then
  begin
    try
      try
        lbConnection_Information.Caption := 'Going to root...';
        myFTP.ChangeDir('/');
        lbConnection_Information.Caption := 'At root, getting DirList...';

        DirList := TStringList.Create;
        myFTP.List(DirList, '', True);

        lbConnection_Status.Caption := '';
        lbConnection_Information.Caption := IntToStr(DirList.Count) + ' files and folders found';

        mDirectories.Lines.Assign(DirList);
      except
        on e:Exception do
        begin
          lbConnection_Information.Caption := 'Unable to show contents';
          lbConnection_Status.Caption := e.Message;
        end;
      end;
    finally
      FreeAndNil(DirList);
    end;
  end
  else
    lbConnection_Status.Caption := 'You are not connected...';
  {$ENDREGION 'Connected?'}
end;

How can I replicate this using the TSslFtpClient?

 

Also what do the options:-

SslFtpClient1.Passive := True;
SslFtpClient1.Binary := True;

 

do?

 

Thanks

Share this post


Link to post

You are looking at a low level component where you'd need to code all that stuff yourself. 

 

Please use TIcsFtpMulti instead, which reads directories automatically and downloads or uploads multiple files with a single function call.  The main sample is OverbyteIcsXferTst, but there also is a very simple sample in OverbyteIcsSnippets where you can press a button to download sample files. 

 

Angus

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×