Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
13.9k views
in .NET FTP by (1.7k points)
Hello,
Once the FTPSESSION is open I perform the following:

Dim remoteFiles() As String = FTPSESSION.Dir()
Dim remoteFile As String
Dim fileCount As Integer = 0
For Each remoteFile In remoteFiles
....
Next

If no files are found, an error is thrown.
I suppose I could catch the error however, an error I believe should not be thrown.

Transfer mode is ACTIVE.

Thanks.

8 Answers

0 votes
by (1.7k points)
This does NOT appear to be a problem for PASV transactions.
0 votes
by (161k points)
It shouldn't do that, sounds like a bug.

Do you have a stack trace at all?

If no files are found, an error is thrown.
I suppose I could catch the error however, an error I believe should not be thrown.

Transfer mode is ACTIVE.

Thanks.
0 votes
by (1.7k points)
Parameter: FTPWeather
--------------------
Transpose: Opening Log
User Domain: NA, User ID: WTROBE1
Retrieving FTP parameters from database for alias: FTPWEATHER
Creating instance of 'FTPWEATHER' worker class
220 FTP Server ready.
Attempting login with ID 'cuexxon'
Login Successful
Forcing 'PASV' for all transports
Executing FTP job
Forcing transport to 'ACTIVE' mode (for FIREWALL access)
Server Environment: ''
---> PORT 192,168,133,145,16,150
200 PORT command successful
---> NLST
450 No files found
EnterpriseDT.Net.Ftp.FTPException: No files found
at EnterpriseDT.Net.Ftp.FTPControlSocket.ValidateReply(String reply, String[] expectedReplyCodes)
at EnterpriseDT.Net.Ftp.FTPClient.Dir(String dirname, Boolean full)
at EnterpriseDT.Net.Ftp.FTPClient.Dir()
at SecureFTP.FTPWeather.Execute() in C:\DWConnect\SecureFTP\WorkerClasses\FTPWeather.vb:line 24
EnterpriseDT.Net.Ftp.FTPException: No files found
at SecureFTP.FTPWeather.Execute() in C:\DWConnect\SecureFTP\WorkerClasses\FTPWeather.vb:line 53
at SecureFTP.FTPManager.ExecuteFTP() in C:\DWConnect\SecureFTP\FTPManager.vb:line 40
Transpose: Job Status-1
0 votes
by (161k points)
Exactly what we need, thanks. If you get a chance to post the log from the same in PASV mode, that would be brilliant. I'm curious why it succeeds with one and not the other ??

---> NLST
450 No files found
0 votes
by (1.7k points)
Unfortunately, I cannot.

I have two interfaces that use PASV; however, I cannot call them from work because the remote server accepts connects from privelidged IP's of which mine is not:(

However, I'll run the code tonight @ home using PASV and perhaps will be able to provide it tomorrow.
0 votes
by (161k points)
Actually, it is unnecessary. I can see the bug. in the code.

This is fixed in 1.1.0 which will be out in a few days.

If you can't wait, change line 1197 (I think) in FTPClient.cs from:

if (!lastValidReply.ReplyCode.Equals("550"))

to

if (!lastValidReply.ReplyCode.Equals("450") &&
!lastValidReply.ReplyCode.Equals("550"))

this will hopefully do the trick.

Unfortunately, I cannot.

I have two interfaces that use PASV; however, I cannot call them from work because the remote server accepts connects from privelidged IP's of which mine is not:(

However, I'll run the code tonight @ home using PASV and perhaps will be able to provide it tomorrow.
0 votes
by (1.7k points)
That didn't work.

Seems we also need to do the following as I suppose 450 is a valid response:
string[] validCodes1 = new string[]{"125", "150", "450", "550"};
0 votes
by (161k points)
Oops, that's right.

That didn't work.

Seems we also need to do the following as I suppose 450 is a valid response:
string[] validCodes1 = new string[]{"125", "150", "450", "550"};

Categories

...