Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 255
  • Last Modified:

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

0
TheOn3
Asked:
TheOn3
  • 3
  • 2
1 Solution
 
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now