Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

i need a code for file transfer

Posted on 2009-07-04
5
Medium Priority
?
252 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 375 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

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 I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

721 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