Hi,
I don't know if you know something about TALWinInteFTPClient, but maybe it doesn't depend on it. I am using this class to access to the ftp server. I connect, then I check the connection and everything is good.
So I need to get the tree of files and directories on the ftp server. To do this, I use this function:
procedure TForm2.FileTransfer(const PathName, FileName, RemotePath : string; const InDir : boolean);
var Rec : TALFtpclientSearchRec;
Path : string;
begin
Path := PathName;
if ALWinInetFTPClient11.FindFirst(Path + FileName, faAnyFile, Rec) = 0 then
try
repeat
if (Rec.Attr = faDirectory) AND (InDir) AND (Rec.Name <> '.') AND (Rec.Name <> '..') then
FileTransfer(Path + Rec.Name + '/',FileName,RemotePath,InDir)
else
if (Rec.Name <> '.') AND (Rec.Name <> '..') then
Memo1.Lines.Add(Path + Rec.Name);
until ALWinInetFTPClient11.FindNext(rec) <> 0;
finally
ALWinInetFTPClient11.FindClose(rec);
end;
end;
for example, let's have this directory on ftp, "data". In the "data", there is directory named "web" which contains one file. And in the "data", there's another file too. After I run this procedure with first parameter set to "data/", the Memo1 shows this "data/file.php". But the next directory "data/web/" is just opened. There's a file but this procedure at FindFirst will stop and return. So in the Memo1 is just one line, "data/file.php".
+data
+web
-img.jpg
-file.php
I don't know, why the "FindFirst" stop when it goes into another directory.
Please, could you help me? :icon_rolleyes: