Recent

Author Topic: indy10 ftpclient list folder show empty list  (Read 2951 times)

eldonfsr

  • Sr. Member
  • ****
  • Posts: 295
indy10 ftpclient list folder show empty list
« on: January 08, 2022, 08:16:13 pm »
Hello its possible on ftpclient on root folder get list of folders at ftp server...
i have this code but always show empty list
Code: Pascal  [Select][+][-]
  1. procedure TFomMain.FormShow(Sender: TObject);
  2. var i,ld:integer;
  3.   Tr:tstrings;
  4.   fi:string;
  5.   Tt:tidftplistitems;
  6.   T:tidftplistitem;
  7. begin
  8.   FPXMLBFtp.LoadFromFile('FTPSetting.xml');
  9.   TR:= Tstringlist.create;
  10.   idFTP1.Host:= FPXMLBFTP.GetAttrValueByName('Server.ip', 'value');
  11.   idFTP1.Passive:=true;
  12.   idFTP1.Username:=FPXMLBFTP.GetAttrValueByName('Server.user', 'value');
  13.   idFTP1.Password:=FPXMLBFTP.GetAttrValueByName('Server.password', 'value');
  14.   idFTP1.Port:=strtoint(FPXMLBFTP.GetAttrValueByName('Server.port', 'value'));
  15.   Statusbar1.Panels[0].Text:='No Conncted , wait';
  16.   idFTP1.Connect;
  17.   if(idFTP1.Connected = true) then begin
  18.     Statusbar1.Panels[0].Text:='Conncted to '+ idFTP1.Host;
  19.     idFTP1.ChangeDir('..');
  20.     idFTP1.List('*',true);
  21.     Memo1.Lines.Add(idFTP1.RetrieveCurrentDir);
  22.     for i:=0 to Idftp1.directorylisting.Count-1 do begin
  23.       if((IdFTP1.DirectoryListing[I].ItemType = ditDirectory) and (IdFTP1.DirectoryListing[I].FileName <> '.') and (IdFTP1.DirectoryListing[I].FileName <> '..')) then begin
  24.         Memo1.Lines.Add(IdFTP1.DirectoryListing[I].FileName);
  25.       end else  if( IdFTP1.DirectoryListing[I].ItemType = ditFile) then begin
  26.          Memo1.Lines.Add(IdFTP1.DirectoryListing[I].FileName);
  27.       end;
  28.     end;
  29.  
  30.  
  31. end;
  32.  
  33.  
  34.  

eldonfsr

  • Sr. Member
  • ****
  • Posts: 295
Re: indy10 ftpclient list folder show empty list
« Reply #1 on: January 08, 2022, 10:38:29 pm »
What i need to do of this error

rvk

  • Hero Member
  • *****
  • Posts: 4702
Re: indy10 ftpclient list folder show empty list
« Reply #2 on: January 08, 2022, 10:49:04 pm »
Add IdAllFTPListParsers to the uses clause.

Or you can add IdFTPListParseUnix or IdFTPListParseWindowsNT individually.

eldonfsr

  • Sr. Member
  • ****
  • Posts: 295
Re: indy10 ftpclient list folder show empty list
« Reply #3 on: January 08, 2022, 11:01:04 pm »
Send me error can't find IdFTPListParseUnix , could be a problem because i install indy from package on line could better download and install package...

Thanks For help

Remy Lebeau

  • Hero Member
  • *****
  • Posts: 1114
    • Lebeau Software
Re: indy10 ftpclient list folder show empty list
« Reply #4 on: January 10, 2022, 02:15:50 am »
Send me error can't find IdFTPListParseUnix , could be a problem because i install indy from package on line

IdFTPListParseUnix.pas is located in the same folder as IdFTP.pas.  If you are installing indylaz.lpk manually, you will probably have to update it to include that .pas file, as it includes only a handful of files needed to register the main Indy components, but not secondary classes, like the FTP list parsers, I think.

could better download and install package...

Are you not installing Indy via OPM?
Remy Lebeau
Lebeau Software - Owner, Developer
Internet Direct (Indy) - Admin, Developer (Support forum)

eldonfsr

  • Sr. Member
  • ****
  • Posts: 295
Re: indy10 ftpclient list folder show empty list
« Reply #5 on: January 11, 2022, 03:32:50 am »
Well Thanks for your help i get work my ftpclient i put code here come could be need it.


Thanks for you great help....

 

TinyPortal © 2005-2018