Solved

i need a code for file transfer

Posted on 2009-07-04
5
243 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 36

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 36

Accepted Solution

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

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

758 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

19 Experts available now in Live!

Get 1:1 Help Now