Here is some example code for read/ write data:
// CallBack function, add more THookSocketReason events in case .. procedure TftpForm.SockPutCallBack(Sender: TObject; Reason: THookSocketReason; const Value: string); begin case Reason of HR_WriteCount: // HR_ReadCount // Value contains number of bytes begin inc(CurrentBytes, StrToIntDef(Value, 0)); // Increment uploaded bytes ProgressBar.Position := Round(1000 * (CurrentBytes / TotalBytes)); end; HR_Connect: CurrentBytes := 0; // Reset (* else begin v := getEnumName(typeInfo(THookSocketReason), integer(Reason)) + ' ' + Value); MemoLog.Lines.Add(v); // Show log in a Memo field end; *) end; end; // Init callback: ftp := TFTPSend.Create; try ftp.DSock.OnStatus := SockPutCallBack; // Update progressbar ftp.Username := .... ...
Download full example-code here: ftpdemo3.zip