I'm having trouble figuring out where to put the "Send file" bit of an
ftpserv component, and once that part is figured out, the best way to
send the file data.
In one program, I have an FtpClient component..
GetFiles : array[1..10] of string;
GetFiles := 'michael.dat';
(and so on)
FtpClient1.(all sorts of settings)
then I cheat (Francois probably won't like this bit)
if FtpClient1.open then
if FtpClient1.User then
if FtpClient1.Pass then
for i := 1 to 10 do
(re-set all of the FtpClient1.properties like FtpTst1's
ExecuteCmd() does )
FtpClient1.HostFileName := GetFiles[i];
if FtpClient1.get then
memo1.lines.add('Cant download '+GetFiles[i]);
Okay! Now on to the FtpServer..
Judging by the example (FtpServ1.pas) .. The best place to send the file
is in the OnRetrSessionConnected event.. Here's what I tried to do, but
found that it didnt work
var fil : file of byte;
buf : array[1..2048] of byte;
rec : integer;
(assign the datastream)..
if rec > 0 then
until (rec=0) or (application.terminated);
And thatd be it. I get zero bytes transferred, and the ftp server itself
What's the better way to do this?
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be