Habe das Problem jetzt mit den Indys ungefähr so behoben:
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
const
myfile = 'Test.avi';
var
AStream: TFileStream;
begin
if IdFTP1.Connected then
IdFTP1.Disconnect;
IdFTP1.Host := '192.168.0.10';
IdFTP1.Port := 21;
IdFTP1.Username := 'xxx';
IdFTP1.Password := 'xxx';
if FileExists(TargetFile) then begin
AStream := TFileStream.Create(TargetFile, fmOpenReadWrite);
AStream.Position := AStream.Size;
end else
AStream := TFileStream.Create(TargetFile, fmCreate);
IdFTP1.Connect(True, -1);
if IdFTP1.Connected then begin
ProgressBar1.Max := IdFTP1.Size(myfile);
IdFTP1.Get(myfile, AStream, True);
IdFTP1.Disconnect;
end;
AStream.Free;
end;