Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3.6k views
in .NET FTP by
I have tested this new function in edtFTPnet 1.2.1 and I can

4 Answers

0 votes
by (51.6k points)
It's a bug.

You are right, it should be
if (OnDownloading(localPath, remoteFile))

instead of
if (!OnDownloading(localPath, remoteFile))

i.e. no negation.

However, I don't understand why you should need to set EventsEnabled to false. Are you sure about this?

- Hans (EDT Support)
0 votes
by
I have run the code with these changes:
this.ftpConnection1.EventsEnabled = true;

if (OnDownloading(localPath, remoteFile))

As you can se in the log, it sends a SIZE command to the FTP and expects 213 but retrieves 226.
This results in a 0 kb file and an exception from ValidateReply() in FTPControlSocket.cs
If I turn off events, then the SIZE command will never be sent.
DEBUG [EnterpriseDT.Net.Ftp.FTPClient] 11 okt 2005 11:07:21.371 : Connecting to 127.0.0.1:21
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 11 okt 2005 11:07:21.403 : 220 Microsoft FTP Service
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 11 okt 2005 11:07:23.403 : ---> USER XXXXXX
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 11 okt 2005 11:07:23.403 : 331 Password required for XXXXXX.
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 11 okt 2005 11:07:24.575 : ---> PASS ********
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 11 okt 2005 11:07:24.575 : 230 User XXXXXX logged in.
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 11 okt 2005 11:07:25.293 : ---> TYPE A
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 11 okt 2005 11:07:25.293 : 200 Type set to A.
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 11 okt 2005 11:07:25.981 : ---> SIZE TextDocument.txt
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 11 okt 2005 11:07:25.981 : 213 16950
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 11 okt 2005 11:07:26.606 : ---> PASV
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 11 okt 2005 11:07:26.606 : 227 Entering Passive Mode (127,0,0,1,8,32).
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 11 okt 2005 11:07:27.184 : ---> RETR TextDocument.txt
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 11 okt 2005 11:07:27.184 : 125 Data connection already open; Transfer starting.
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 11 okt 2005 11:07:27.809 : ---> SIZE TextDocument.txt
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 11 okt 2005 11:07:27.809 : 226 Transfer complete.
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 11 okt 2005 11:07:33.637 : ---> SIZE TextDocument.txt
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 11 okt 2005 11:07:33.637 : 213 16950


/ Carl
0 votes
by (162k points)
Unfortunately, it looks like events must be disabled - the TransferComplete event is actually called before the 226 Transfer succeeded reply is sent. TransferComplete I think calls SIZE, and the next reply is that of 226 - not 213.

We will fix this in the next release which won't be too long.
0 votes
by (162k points)
Version 1.2.2, which is now released, shoujld fix this problem.

Unfortunately, it looks like events must be disabled - the TransferComplete event is actually called before the 226 Transfer succeeded reply is sent. TransferComplete I think calls SIZE, and the next reply is that of 226 - not 213.

We will fix this in the next release which won't be too long.

Categories

...