Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3.6k views
in .NET FTP by (280 points)
I'm explicitly setting the port:
sftpConnection.ServerPort = 21;
but receive a timeout error, which lists the correct ip but a different port (22).
I can connect via FTPConnection no problem. When I log in to partner ftp site via cmd line, it lists Enterprise 2.x.x Secure FTP connected - I'm assuming it is SFTP compatible.

Any thoughts on what my problem may be?

Thanks!

2 Answers

0 votes
by (51.6k points)
The short answer is - set the port number after you set the protocol. This only necessary because you are trying to use the FTP port for SFTP, which is not really normal.

Here's the long anwer: As you probably know, port 21 is the standard port for FTP and port 22 is the standard port for SFTP. We have some smarts in the SecureFTPConnection.Protocol setter that will change the port number in certain cases. For example, if the Protocol is FTP and the port is 21 when you set the Protocol to SFTP then it will change the port to 22. But if, for example, the port has been set to 12,345 then it will not be changed regardless of how you set the Protocol property.

- Hans (EnterpriseDT)
0 votes
by (280 points)
Thanks for all the answers, Hans.
You are correct (partner does not respond using SFTP/port 22) - I changed to FTP protocol/21 and confirmed this.
BTW - I'm on an FTP crash course here, so you can safely assume I know almost nothing about it :-)

Categories

...