"Connection refused" error with CFFTP

16.6k views Asked by At

I'm trying to setup a connection to FTP to transfer a file. Unfortunately, because of the environment the tools I have available to me are limited.

I'm receiving the following error:

An error occurred while establishing an FTP connection.

Error: Connection refused: connect.

Does this mean that I can reach the FTP server but the credentials are incorrect? Does it mean that I can't reach the server at all? Or is there no way to tell?

Update: I changed the IP address I was using to some other random number, so it's almost certainly because I can't connect. I wish there was a way to tell the difference between connectivity and authorization issues.

4

There are 4 answers

1
Mark On BEST ANSWER

A "Connection Refused" error means that either the server you're trying to connect to isn't running an FTP server, or there's a firewall in your way that's preventing the connection.

An "User Authentication failed" error would usually occur if your credentials are bad.

FYI, for plain old FTP connections, the cfftp.errorCode may give you more information, once your are able to establish a connection. The errorCode will point to the response in the IETF FTP protocol standard , like "425", which would mean "Can't open data connection.".

1
Saul On

You can check your ability to connect to the FTP server using Telnet at the command prompt(On windows, Go to Start > Run > type cmd).

telnet my-domain-name.com 21

you can try at non default port as you wish. That will let you know if your machine can reach the FTP server, and you can try logging on to check your credentials.

Here's a good post: Understanding FTP using raw FTP commands and telnet

2
scrittler On

Could be either one of those cases. Do you have a standalone FTP client to test with? Does it work from another machine?

0
Jon Briccetti On

hey check if your directory attribute is begining with a "/" character. this used to work through cf8 but stopped working for me in cf9 (specifically 9.0.1); also try the following and see if this helps:

<cfftp connection="mycon" server="myserver.com" action="open" username = "anonymous" password = "anonymous" />
<cfdump var="#mycon#" label="">
<cfftp connection="mycon" action="getcurrentdir" result="result"/>
<cfdump var="#result#" label="">

you may find that its the listdir that is giving you the problem, not the connection.