Reputation: 495
I work with Delphi 11.2 and Clever Internet Suite 10.2.
I have a program that copy some files on 2 different FTP servers.
However when I try to list files from ftp folders, one is functioning and the other no.
The same code function for the first FTP and give "450 File not available" for the second FTP.
the code used.
clFtpMain: TclFtp;
clFtpMain.Server := 'storage.rcs-rds.ro';
clFtpMain.Port := 21;
clFtpMain.Username := 'username';
clFtpMain.Password := 'pass';
clFtpMain.PassiveMode := True;
clFtpMain.Timeout := 10000;
clFtpMain.UseTLS := ctNone;
clFTPMain.Open;
clFTPMain.ChangeCurrentDir('/folder');
clFTPMain.DirectoryListing('*'); // <-- error here
any advice?
Upvotes: 0
Views: 163
Reputation: 495
The solution that I find is not to put any filter on the DirectoryListing function.
Apparently enter any params there will result into an exception.
If you dont enter param the listing is ok and bring the files (if exist).
clFTPMain.DirectoryListing(''); // <-- working
Upvotes: 0
Reputation: 598001
Some FTP servers are smart enough to send a 450 reply when there is nothing available to list. This saves having to waste resources creating a data channel that won't send anything.
Whereas some FTP servers will always open a data connection to send a listing, even an empty one.
Either way, a client needs to handle both cases, but it sounds like the client you are using is not treating the 450 case as a non-error. That would be a bug in that component. Contact its author for a fix, or use a different client that does not have that bug.
Upvotes: 1