FTP upload files using PHP to RadioBoss Cloud

winzurf

New member
I'm trying to use my website to replace files on my account using PHP and FTP - I can log in ok but get these error messages when I try to upload a file:

[27-Nov-2022 23:31:39 UTC] PHP Warning: ftp_put(): php_connect_nonb() failed: Operation now in progress (115) in /home/eastbourne/public_html/tts/gtts.php on line 51
[27-Nov-2022 23:31:39 UTC] PHP Warning: ftp_put(): Type set to I. in /home/eastbourne/public_html/tts/gtts.php on line 51

I've tried various changes suggested online, none are helping, so I'm hoping someone may have code that's working?

code sample -----------------
$host= 'c17.radioboss.fm';
$user = '#####';
$password = '#####';
$ftpConn = ftp_connect($host,21,500);
$login = ftp_login($ftpConn,$user,$password);
// check connection
if ((!$ftpConn) || (!$login)) {
echo 'FTP connection has failed! Attempted to connect to '. $host. ' for user '.$user.'.<br>';
} else{
echo 'FTP connection was a success.<br>';

ftp_set_option($ftpConn, FTP_USEPASVADDRESS, false);
ftp_pasv($ftpConn, true);

$file="horse.mp3";

if (ftp_put($ftpConn, $file,$file, FTP_BINARY)) {
echo "successfully uploaded ".$file."<br><br>";
} else {
echo "There was a problem while uploading ". $file."<br><br>";
}
 
I'm trying to use my website to replace files on my account using PHP and FTP - I can log in ok but get these error messages when I try to upload a file:

[27-Nov-2022 23:31:39 UTC] PHP Warning: ftp_put(): php_connect_nonb() failed: Operation now in progress (115) in /home/eastbourne/public_html/tts/gtts.php on line 51
[27-Nov-2022 23:31:39 UTC] PHP Warning: ftp_put(): Type set to I. in /home/eastbourne/public_html/tts/gtts.php on line 51

I've tried various changes suggested online, none are helping, so I'm hoping someone may have code that's working?

code sample -----------------
$host= 'c17.radioboss.fm';
$user = '#####';
$password = '#####';
$ftpConn = ftp_connect($host,21,500);
$login = ftp_login($ftpConn,$user,$password);
// check connection
if ((!$ftpConn) || (!$login)) {
echo 'FTP connection has failed! Attempted to connect to '. $host. ' for user '.$user.'.<br>';
} else{
echo 'FTP connection was a success.<br>';

ftp_set_option($ftpConn, FTP_USEPASVADDRESS, false);
ftp_pasv($ftpConn, true);

$file="horse.mp3";

if (ftp_put($ftpConn, $file,$file, FTP_BINARY)) {
echo "successfully uploaded ".$file."<br><br>";
} else {
echo "There was a problem while uploading ". $file."<br><br>";
}
Note - attempt to read directory also returns NULL even though there are files
$contents = ftp_nlist($ftpConn,'.');
var_dump($contents);
 
Does it work if you use FileZilla or any other FTP client? If it does, I think the problem is with the library you use (or it's configured incorrectly). With RB Cloud FTP you should use TLS connection and any transfers are made using Passive mode.
 
Back
Top