Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
1.1k views
in .NET FTP by (160 points)
Hi,

I'm using the free version of edtftpnet, after few months working very well I got the error code=500 when try to invoke the function ftp.GetFiles(ftp.ServerDirectory).

         
                    ftp.ServerAddress = str_URL_FTP
                    ftp.UserName = str_USER_FTP
                    ftp.Password = str_PASSWORD_FTP
                    ftp.Connect()

                    ftp.ChangeWorkingDirectory(str_PATH_FTP)

                    Dim files As String() = ftp.GetFiles(ftp.ServerDirectory)


I need to get the directory file listing to check if the file that I want to upload already exist in the server.
This is the reason that I use GetFiles().

Can anyone help me please?

Here is the snippet code from debug log:

DEBUG [FTPClient] 5 fev 2015 10:43:15.035 : Connecting to ftp.********.com:21
DEBUG [HostNameResolver] 5 fev 2015 10:43:15.035 : Resolving ftp.*****.com
DEBUG [HostNameResolver] 5 fev 2015 10:43:15.035 : ftp.*******.com resolved to 200.185.***.***
INFO [BaseSocket] 5 fev 2015 10:43:15.035 : Connecting to 200.185.***.***21 with timeout 120000 ms
DEBUG [BaseSocket] 5 fev 2015 10:43:15.075 : Successfully connected to 200.185.***.***:21
DEBUG [FTPControlSocket] 5 fev 2015 10:43:15.075 : Setting socket timeout=120000
INFO [FTPControlSocket] 5 fev 2015 10:43:15.075 : Command encoding=System.Text.SBCSCodePageEncoding
DEBUG [FTPControlSocket] 5 fev 2015 10:43:15.075 : StrictReturnCodes=False
DEBUG [FTPControlSocket] 5 fev 2015 10:43:15.385 : 220-CompanyName FTP Server
DEBUG [FTPControlSocket] 5 fev 2015 10:43:15.615 : 220 Please enter your name:
DEBUG [FTPConnection] 5 fev 2015 10:43:15.615 : Connected to ftp.*************.com (instance=0)
DEBUG [FTPControlSocket] 5 fev 2015 10:43:15.625 : ---> USER ffa
DEBUG [FTPControlSocket] 5 fev 2015 10:43:15.675 : 331 User name okay, Need password.
DEBUG [FTPControlSocket] 5 fev 2015 10:43:15.675 : ---> PASS ********
DEBUG [FTPControlSocket] 5 fev 2015 10:43:16.015 : 230 User logged in.
DEBUG [FTPConnection] 5 fev 2015 10:43:16.015 : Successfully logged in
INFO [FTPConnection] 5 fev 2015 10:43:16.015 : Auto FEAT disabled
DEBUG [FTPControlSocket] 5 fev 2015 10:43:16.015 : ---> TYPE I
DEBUG [FTPControlSocket] 5 fev 2015 10:43:16.055 : 200 Type set to I.
DEBUG [FTPControlSocket] 5 fev 2015 10:43:16.055 : ---> PWD
DEBUG [FTPControlSocket] 5 fev 2015 10:43:16.115 : 257 "/" is current directory.
DEBUG [FTPConnection] 5 fev 2015 10:43:16.115 : ChangeWorkingDirectory('PCH GALERA/03 B

3 Answers

0 votes
by (162k points)
That's a server error. It is trying to create a new socket to transfer the listing on, and it has failed to bind. You can't do much about it - it usually happens if you've done a lot of small transfers and the server has run out of file descriptors.
0 votes
by (160 points)
Thanks for the reply.

I did a test using Filezilla..
The bind error show anyway, but Filezilla do something that lists the directory.
Same happens with Windows Explorer, CuteFTP, etc.

See the snippet code from Filezilla console:

Reply: 250 "/PCH GALERA/03 B
0 votes
by (162k points)
Filezilla is just retrying the listing if it fails - you could do the same thing in your code.

Categories

...