Hi, I'm evaluating your product so I downloaded edtFTPnet/Free 1.3.0 and I'm trying it with a non-standard FTP server that I have to face with.
I accepts custom commands and return custom results.
I was able to send custom commands using InvokeFTPCommand successfully but when I have to read data from a LIST command I've some problem. First of all FTPConnection does not have an InvokeDataCommand so a custom command that use a data connection seems to be impossible to be sent.
As LIST is a standard command (also if the server returns a non standard output) I tried with FTPClient, both with Active and Passive mode but it always return an empty list.
Looking at the log I see
DEBUG [FTPControlSocket] 28 nov 2008 17.21.18.578 : ---> USER root
DEBUG [FTPControlSocket] 28 nov 2008 17.21.18.578 : 230 User root logged in.
DEBUG [FTPControlSocket] 28 nov 2008 17.21.27.953 : ---> PASV
DEBUG [FTPControlSocket] 28 nov 2008 17.21.27.953 : 227 Entering passive mode (172,16,0,20,18,132)
DEBUG [FTPControlSocket] 28 nov 2008 17.21.27.953 : Server supplied address=172.16.0.20
DEBUG [FTPControlSocket] 28 nov 2008 17.21.27.953 : Server supplied port=4740
DEBUG [FTPControlSocket] 28 nov 2008 17.21.27.953 : NewPassiveDataSocket(172.16.0.20,4740)
DEBUG [FTPControlSocket] 28 nov 2008 17.21.27.953 : ---> LIST testdir
DEBUG [FTPControlSocket] 28 nov 2008 17.21.27.953 : 150 Opening new data connection for "testdir".
DEBUG [FTPClient] 28 nov 2008 17.21.27.968 : Reading ASCII listing data
DEBUG [FTPControlSocket] 28 nov 2008 17.21.28.125 : 226 Transfer complete.
DEBUG [FTPClient] 28 nov 2008 17.21.28.125 : No listing data found
or
DEBUG [FTPControlSocket] 28 nov 2008 17.17.36.843 : ---> USER root
DEBUG [FTPControlSocket] 28 nov 2008 17.17.36.843 : 230 User root logged in.
DEBUG [FTPControlSocket] 28 nov 2008 17.17.44.828 : NewActiveDataSocket(0)
DEBUG [FTPControlSocket] 28 nov 2008 17.17.44.828 : ---> PORT 172,16,3,50,8,14
DEBUG [FTPControlSocket] 28 nov 2008 17.17.45.125 : 200 PORT command successful.
DEBUG [FTPControlSocket] 28 nov 2008 17.17.45.125 : ---> LIST doneq
DEBUG [FTPControlSocket] 28 nov 2008 17.17.45.125 : 150 Opening new data connection for "doneq".
DEBUG [FTPClient] 28 nov 2008 17.17.45.140 : Reading ASCII listing data
DEBUG [FTPActiveDataSocket] 28 nov 2008 17.17.45.140 : AcceptConnection() succeeded
DEBUG [FTPControlSocket] 28 nov 2008 17.17.45.359 : 226 Transfer complete.
DEBUG [FTPClient] 28 nov 2008 17.17.45.359 : No listing data found
It seems that no result are returned from the server but if I connect with a linux box to the ftp and I launch the same command I see
-> USER root
331 Password required for root.
Password:
-> PASS XXXX
230 User root logged in.
-> PORT 127,0,0,1,212,4
200 PORT command successful.
-> LIST testdir
150 Opening new data connection for "testdir".
XXX XXX X XXX XXX XXXXX
XXX XXX X XXX XXX XXXXX
XXX XXX X XXX XXX XXXXX
XXX XXX X XXX XXX XXXXX
XXX XXX X XXX XXX XXXXX
XXX XXX X XXX XXX XXXXX
(for 250 times)
226 Transfer complete.
So I would like to know:
- If I can send data commands using FTPConnection
- If I'm doing something wrong launchin LIST command.
I give you a piece of my code
_Connection = new EnterpriseDT.Net.Ftp.FTPClient();
_Connection.RemoteHost = serverAddress;
_Connection.ControlPort = serverPort;
_Connection.Connect();
_Connection.Login(userName, password);
string[] response = _Connection.Dir("testdir",true);