Forum > Networking and Web Programming

(SOLVED) Is there anybody using FTP client (Indy ou Lnet)

(1/2) > >>

Hi all,

I'm trying to make a console program (Mac OS X) which has to download a file from a FTP server. I've tried Indy and Lnet. With both, I just get empty file (0 kb).

Of course I have verified that the file to download is present, etc. I can download it using FileZilla with same host, user and password.

Any Idea ?


sinfoni, the example code (using LNet) would be useful.

I've written once a simple MacOSX FTP client front-end for external 'ftp' tool. Quite cheap solution :)

Yes, it's ok. :) As I've began my FTP client using Indy, then Lnet because of Indy does not work, but still get empty file, I thought the... truth was out there.

I've compiled and used successfully the Lnet ftp example, and now, mine is also ok.


Hi, this is a little piece of code, thats download a file from a ftp server. This works with Indy, I have test this in linux and windows, and works.

First, obtaint the list of files, in this case zip, only.

--- Quote ---    
     FTP := TIdFTP.Create( nil );
     FTP.Username := 'user123';
     FTP.Password := 'pas123';
     FTP.Host := '';
        aLog('Intentando conectar para recuperar lista de archivos...');
        aLog('Conexión establecida.');

           aLog(DateTimeToStr(Now) + '  No se logro establecer la conexión con el servidor FTP.');


     FTP.ChangeDir( '/myfiles/' );

     numFiles := FTP.DirectoryListing.Count;

     SetLength(aFilesftp, numFiles);

     for I:= 0 to numFiles - 1 do
         aFilesftp := FTP.DirectoryListing.Items.FileName;

--- End quote ---

After choose a file, get it.
--- Quote ---     FTP.Get( FileName , CurrDir+'\bk\'+FileName, False, False );
     RenameFile := Filename + '.down';
     FTP.Rename ( FileName, RenameFile );

--- End quote ---

Thanks redycc, but IdFTP definitly doesn't work with Mac OS X.

Note that the IdHttp component has also some problems with Mac OS X. I use it, but I have to free it then recreate it before each connexion, otherwise an exception occurs.

Indy is very unstable for this platform. Moreover, it's annoying, but IdFTP component triggers exception on success. I can't understand this behavior (neither agree with it).

I still use it only for windows/delphi environment.   


[0] Message Index

[#] Next page

Go to full version