Solved

i need a code for file transfer

Posted on 2009-07-04
5
244 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

895 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now