I am trying to upload a file to an FTP Server via a PHP script. The connection works and I can create subdirectories on the server. However ftp_put gives the following error:
Warning: ftp_nb_put() [function.ftp-nb-put]: php_connect_nonb() failed: Operation now in progress (115) in ...
Warning: ftp_nb_put() [function.ftp-nb-put]: Type set to I in ....
This is the script
$conn_id = ftp_ssl_connect($ftpHost);#
$login_result = ftp_login($conn_id, $ftpUser, $ftpPw);
ftp_pasv($conn_id, true);
// Verbindung überprüfen
if ((!$conn_id) || (!$login_result))
{
// no Connection
}else{
// Connection WORKS!
if(!@ftp_chdir ( $conn_id , $ftpDir )){
// ftp_mkdir WORKS!
@ftp_mkdir($conn_id, $ftpDir);
}//if(!@ftp_chdir ( $conn_id , $ftpDir )){
if (ftp_put($conn_id, $myFile, $targetfile, FTP_BINARY)) {
// Upload success: NOT WORKING!
}
}
}//if ((!$conn_id) || (!$login_result))
How can I change my script to get my desired behaviour?
false
in second parameter offtp_pasv
function. If it works, then it means you are behind the firewall. – codelearner