...var s: string; i: Integer; Buf: array[0..65535] of Byte;begin if FTP.CurrentStatus = fsRetr then begin // getting file, save to file i := FTP.GetData(Buf, 65535); if i > 0 then begin if Length(CreateFilePath) > 0 then begin FFile := TFileStream.Create(CreateFilePath, fmCreate or fmOpenWrite); CreateFilePath := ''; end; FFile.Write(Buf, i); end else begin // file download ended...
i := FTP.GetData(Buf, SizeOf(Buf));
FFile.Write(Buf, i); end else if FDLDone + i >= FDLSize then begin // done whole file // file download ended
You've found a nice bug here