Solved

i need a code for file transfer

Posted on 2009-07-04
5
248 Views
Last Modified: 2013-11-23
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
Comment
Question by:TheOn3
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 24778809
0
 

Author Comment

by:TheOn3
ID: 24780426
yes, now i have the info and the SendFile procedure, only need the ReceiveFile procedure from now on
0
 
LVL 37

Accepted Solution

by:
Geert Gruwez earned 125 total points
ID: 24783978
0
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 24784016
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
 

Author Comment

by:TheOn3
ID: 24786416
i forget comments: thanks :)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question