i need a code for file transfer

im using ScktComp for file transfer and need a demo using BlockRead - BlockWrite || SendBuf - ReceibeBuf

i code this but dont have idea how it works, i need similar code full with OpenDialogs


procedure SendFile(FilePath: String; Socket: TCustomWinSocket);
var
 F: File;
 Buffer: array [0..4095] of Char;
begin
 AssignFile(FromF, FileFrom) ;
 Reset(FromF, 1) ;
 repeat
   BlockRead(F, Buffer, SizeOf(Buffer), NumRead) ;
   Socket.SendBuf(Buffer, NumRead) ;
  until (NumRead = 0) ;
  CloseFile(F) ;
end;

Open in new window

TheOn3Asked:
Who is Participating?
 
Geert GruwezOracle dbaCommented:
0
 
TheOn3Author Commented:
yes, now i have the info and the SendFile procedure, only need the ReceiveFile procedure from now on
0
 
Geert GruwezOracle dbaCommented:
the Tomes of Delphi has a vast explanation and lots of samples for this:
http://veerle-en-geert.be/delphi/ebooks/Delphi%20-%20The%20Tomes%20of%20Delphi%20-%20Basic%2032-Bit%20Communications%20Programming.pdf

look for page info around page 160
0
 
TheOn3Author Commented:
i forget comments: thanks :)
0
All Courses

From novice to tech pro — start learning today.