I have some simple ftp code to upload and then download a file. 
It seems to upload OK and claims to download OK, but nothing is written to 
the hard drive after downloading. What am I doing wrong ?
The OK message at the end is being displayed and if I add a 
FtpClient1Progress event, it seems to count through the correct number of 
bytes, it's just 'c:\file_download_check.dsr' doesn't get created.

        FTPClient1.connect;
        FTPClient1.HostDirName := paramstr(1);
        FTPClient1.HostFileName := paramstr(3);
        FTPClient1.localfilename := paramstr(2);
        if FTPClient1.Cwd() then 
        begin
          if not (FTPClient1.Binary) then 
          begin
            FTPClient1.Binary := true;
            FTPClient1.TypeSet();
          end;
          FTPClient1.dele;
          FTPClient1.put;
        end;
        memo1.lines.add('Downloading...');
        // now downlaod it and test it's OK
        FTPClient1.HostDirName := paramstr(1);
        FTPClient1.HostFileName := paramstr(3);

        FTPClient1.localfilename := 'c:\file_download_check.dsr';
        if FTPClient1.Cwd() then 
        begin
          if not (FTPClient1.Binary) then 
          begin
            FTPClient1.Binary := true;
            FTPClient1.TypeSet();
          end;
          if FTPClient1.get then showmessage('ok');
        end;

regards

David

############################################################
David Rose

Navigator Systems Ltd,
Network Business Centre, 3 Gloucester Street,
Bath, BA1 2SE,UK

Main Tel: +44 (0)7000 NAVSYS (628797)
Fax: +44 (0)7000 NAVFAX (628329)

Company Email: [EMAIL PROTECTED] (Private e-mail on request)

CONFIDENTIALITY NOTICE

The contents of this e-mail are confidential to the ordinary user of
the e-mail address to which it was addressed and may also be
privileged.  If you are not the addressee of this e-mail you may not
copy, forward, disclose or otherwise use it or any part of it in any
form whatsoever.  If you have received this e-mail in error please
e-mail the sender by replying to this message.
-- 
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

Reply via email to