Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
5.1k views
in .NET FTP by (340 points)
I am using version 2.2.2 and the FTPConnection class. Function Exist(remote file) intermittently error out either with CODE=425

- EnterpriseDT.Net.Ftp.FTPException {"Can't open data connection. (code=425)"} EnterpriseDT.Net.Ftp.FTPException
_HResult -2146232832 Integer
_message "Can't open data connection." String
+ Data {System.Collections.ListDictionaryInternal} System.Collections.IDictionary
HelpLink Nothing String
HResult -2146232832 Integer
InnerException Nothing System.Exception
IsTransient False Boolean
Message "Can't open data connection. (code=425)" String
ReplyCode 425 Integer
Source "edtFTPnet" String
StackTrace " at EnterpriseDT.Net.Ftp.FTPControlSocket.ValidateReply(FTPReply reply, String[] expectedReplyCodes) at EnterpriseDT.Net.Ftp.FTPControlSocket.SetDataPort(IPEndPoint ep) at EnterpriseDT.Net.Ftp.FTPClient.Exists(String remoteFile) at EnterpriseDT.Net.Ftp.FTPConnection.Exists(String remoteFile) at ICTCheckin.myFTPConnect.moveFile(String tsource, String tdes) in F:\DOTNET\ICTCheckin\ICTCheckin\myFTPConnect.vb:line 190" String
+ TargetSite {EnterpriseDT.Net.Ftp.FTPReply ValidateReply(EnterpriseDT.Net.Ftp.FTPReply, System.String[])} System.Reflection.MethodBase



If I repeatedly call this function the result is intermittently. 50% will return the correct result and 50% with have exception as shown. Is there any reliable way to query for existed remote file from the FTP server?
Thank you,

Hugh

4 Answers

0 votes
by (51.1k points)
Can you please enabled logging at the DEBUG level and post the relevant portion of the log.

- Hans (EnterpriseDT)
0 votes
by (340 points)
Switch to the latest Pro version and the error gone away. I still try to run some more test with logging turn on. As soon as I see the same error, I will post the log.
0 votes
by (340 points)
Got the error again with the Pro version. Turned on log file and emailed the log to support. Please check.
Thank you,

Hugh
0 votes
by (161k points)
It wasn't detecting that the file wasn't found from the msg returned from SIZE. Solution is to do this:

myftp.FileNotFoundMessages.Add("CANNOT FIND")

Categories

...