function TFtp.FolderExists(AFolder: string): Boolean;
var ms: TstringList;
i: Integer;
begin
Result := False;
ms := TstringList.Create;
if ftp.Connected then
begin
ftp.List(ms);
for i := 0 to ms.Count - 1 do
begin
if Pos(UpperCase('<DIR>'), Uppercase(ms.Strings)) <> 0 then
begin
Result := True;
Break;
end;
end;
end;
FreeAndNil(ms);
end;