Solved

i need a code for file transfer

Posted on 2009-07-04
5
249 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 38

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 38

Accepted Solution

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

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month9 days, 19 hours left to enroll

624 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