mittlerweile mache ich es so,
das mit dem fileexists funktioniert aber auch hier nicht..
Delphi-Quellcode:
procedure TForm1.Button2Click(Sender: TObject);
var
i: Integer;
MyListing: TStringList;
begin
if TransferringData then Form1.idFTP1.Abort;
if Form1.IdFTP1.Connected then Form1.IdFTP1.Disconnect;
try
with IdFTP1 do begin
Connect;
if Connected then begin
ChangeDir('/test/leer/');
MyListing := TStringList.Create;
List(MyListing, '*.txt', True);
for i := 0 to DirectoryListing.Count - 1 do
with DirectoryListing[i] do begin
Application.ProcessMessages;
ProgressBar1.Max := Size;
Label1.Caption := 'Downloading ' + FileName + ' (' + IntToStr(Size) + ' bytes)';
if FileExists(Filename) then
Continue;
Get(FileName, DestinationFolder + '\' + FileName, True, True);
end;
Disconnect;
ProgressBar1.Max := 0;
Label1.Caption := '';
end; end;
except;
end;
end;