MList is not supported

+1 vote
asked Oct 11, 2013 by al duhuez (340 points)
edited Oct 17, 2013

Hello, I am running into an issue with the ncftpd ftp server where the MList is not supported. The FEAT command is also not supported.

We are using the RebexFtp.FileExists command in version 4.0.4700.0.

Any suggestions on how to catch this and issue another command like size?

Thanks. -brandon

Here is the FTP log output:

2013-10-11 11:02:45.688 INFO Ftp(9722)[129] Command: FEAT 2013-10-11 11:02:45.718 INFO Ftp(9722)[129] Response: 211-Extensions supported: 2013-10-11 11:02:45.718 INFO Ftp(9722)[129] Response: CLNT 2013-10-11 11:02:45.718 INFO Ftp(9722)[129] Response: LANG EN* 2013-10-11 11:02:45.718 INFO Ftp(9722)[129] Response: MDTM 2013-10-11 11:02:45.718 INFO Ftp(9722)[129] Response: MFMT 2013-10-11 11:02:45.718 INFO Ftp(9722)[129] Response: MLST Type*;Size*;Modify*;Perm;Unique;UNIX.mode*;UNIX.owner;UNIX.uid;UNIX.group;UNIX.gid; 2013-10-11 11:02:45.718 INFO Ftp(9722)[129] Response: PASV 2013-10-11 11:02:45.718 INFO Ftp(9722)[129] Response: REST STREAM 2013-10-11 11:02:45.718 INFO Ftp(9722)[129] Response: SIZE 2013-10-11 11:02:45.718 INFO Ftp(9722)[129] Response: UTF8 2013-10-11 11:02:45.718 INFO Ftp(9722)[129] Response: TVFS 2013-10-11 11:02:45.718 INFO Ftp(9722)[129] Response: RFC 959 2389 2577 3659 2013-10-11 11:02:45.718 INFO Ftp(9722)[129] Response: 211 End. 2013-10-11 11:02:45.718 INFO Ftp(9722)[129] Command: SYST 2013-10-11 11:02:45.748 INFO Ftp(9722)[129] Response: 215 UNIX Type: L8 2013-10-11 11:02:45.748 INFO Ftp(9722)[129] Command: OPTS UTF8 ON 2013-10-11 11:02:45.777 INFO Ftp(9722)[129] Response: 501 Option not recognized. 2013-10-11 11:02:45.811 INFO Ftp(9722)[129] Command: PWD 2013-10-11 11:02:45.840 INFO Ftp(9722)[129] Response: 257 "/" is cwd. 2013-10-11 11:02:47.934 INFO Ftp(9722)[129] Command: MLST testvod2_200.mp4 2013-10-11 11:02:50.963 INFO Ftp(9722)[129] Response: 500 Syntax error, command unrecognized. 2013-10-11 11:02:50.963 ERROR Ftp(9722)[129] Info: Rebex.Net.FtpException: Syntax error, command unrecognized (500). at Rebex.Net.Ftp.1SAJuN(Int32 , Boolean ) at Rebex.Net.Ftp.VD0EjZ(String , 27NpLhZ )

Applies to: Rebex FTP/SSL

1 Answer

+1 vote
answered Oct 14, 2013 by Tomas Knopp (58,890 points)
edited Oct 17, 2013
 
Best answer

Hello,

thank you for your question. According to the log, the server understands the FEAT command. In fact it says that even the MLST command is supported. That's why Rebex Ftp tried to use MLST command when checking for file existence.

However, you can still explicitly disable the MLST extension in Rebex Ftp like this:

Ftp ftp = new Ftp();

// disable MLST/MLSD command
ftp.EnabledExtensions &= ~FtpExtensions.MachineProcessingList;

ftp.Connect("server", port);
ftp.Login("username", "password");
ftp.FileExists("file.txt"));
commented Oct 14, 2013 by al duhuez (340 points)
edited Oct 14, 2013

Great, thank you. Yea, we figured out that even though the MSLT is in the supported features list it is explicitly disabled on the ftp server. That is a better solution to mine, I was issuing an explicit command.

Can I change the EnabledExtentions after the Ftp client is already connected, or does it have to before? Reason I am asking is I would like to do the secondary call if I get a 500 exception from the server.

thanks. -brandon

commented Oct 14, 2013 by Tomas Knopp (58,890 points)
edited Oct 14, 2013

Yes, it is possible to set the EnabledExtensions property where you need in your code. There is no specific need to set it before call to Connect method. So the code below will also work:

Ftp ftp = new Ftp();

ftp.Connect("server", port);
ftp.Login("username", "password");

// disable MLST/MLSD command
ftp.EnabledExtensions &= ~FtpExtensions.MachineProcessingList;

ftp.FileExists("file.txt"));
commented Oct 17, 2013 by al duhuez (340 points)
edited Oct 17, 2013

Cool, thank you. Works like a charm.

...