login about faq

I am having Visual Studio 2008 .Net (.Net 2.0) and tried to secure FTP upload files in .Net Web application (C#).

I have downloaded trial version of chilkat for .Net .

For upload a file I have used the following code as given in your website also provided the proper FTP Server name, UserName and password.

Chilkat. SFtp sftp = new Chilkat.SFtp();

int port;
string hostname;
bool success = true;

//hostname = "www.my-ssh-server.com";
hostname = "";
port = 22;

success = sftp.Connect(hostname, port);
if (success != true)

But is shows the error "No connection could be made because the target machine actively refused it." Could you please clarify how to solve this issue. Say if my ftp server is (remote server where files to be uploaded) and the folder is "FTPTesting" in the remote server and the file is C:/Test1.txt. Please let me know how to connect and upload the file to remote ftp server in secure FTP...

asked Aug 23 '12 at 12:44

chilkat's gravatar image

chilkat ♦♦

A good first step in solving this problem is to Google the error message: "No connection could be made because the target machine actively refused it."

Just cut-and-paste the entire error message into Google: "No connection could be made because the target machine actively refused it."

The 1st search result is this page: http://stackoverflow.com/questions/2972600/no-connection-could-be-made-because-the-target-machine-actively-refused-it

It says:

it literally means that the machine exists but that it has no services listening on the specified port, or there is a firewall stopping you.

If it happens occasionally - you used the word "sometimes" - and retrying succeeds, it is likely because the server has a full 'backlog'.

If it's not a firewall, then it means that no service is listening on port 22. Given the description of the problem, I'm suspecting you're confused about FTP vs SSH/SFTP. See this:

"SFTP" is the Secure File Transfer Protocol over SSH. It is a protocol unrelated to the FTP protocol. The Chilkat SSH / SFTP component is used for "SFTP". SFTP is achieved by connecting to an SSH server at port 22.

On the other hand, the Chilkat FTP2 component is for FTP. FTP servers listen at port 21 (non-SSL/TLS) and port 990 (SSL). FTP over SSL (i.e. port 990) is called "FTPS".

I suspect what you really need is the Chilkat FTP2 component for the FTP protocol, which is for port 21 (or port 990).


answered Aug 23 '12 at 12:49

chilkat's gravatar image

chilkat ♦♦

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Aug 23 '12 at 12:44

Seen: 7,664 times

Last updated: Aug 23 '12 at 12:49

powered by OSQA