This would happen when a incoming or a outgoing port 20 (FTP Data) connection can't be made.
I don't know how PHP ftp functions work but normally the FTP client makes a outgoing connection on port 21, and then the FTP Server makes a incoming connection from port 20 when any kind of data is sent (ie directory listings, or files).... So I'm guessing that the web server that you are running ftp_put on doesn't allow incoming connections... You can try getting around this by setting PHP to use Passive mode, which makes the FTP client connection out to port 20 on the FTP server. A quick look at the manual says that you should use ftp_pasv to make that happen. Hope this helps Andrew ----- Original Message ----- From: "Suhas Pharkute" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, July 26, 2003 11:29 PM Subject: [PHP] FTP - Can't build data connection Hi I am writing a FTP application. When I upload a file I am getting following error, Warning: ftp_put(): Can't build data connection: Connection refused. There is no error for connection/login to ftp site. can any one help? Thanks, Suhas _________________________________ Encrypt your PHP code for FREE at http://encphp.sspsoft.com _________________________________ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php