4
I have the following PHP code to upload PHP files and send to an external server via FTP. However, it returns me the following error when I upload:
Warning: ftp_put(): Illegal PORT command. in /var/www/protocolo/teste/envia.php on line 26
What can it be?
<?php
ini_set("default_charset", "UTF-8");
$ftp_server = "meuhostftp.com.br";
$ftp_username = "root";
$ftp_password = "root";
$conn_id = ftp_connect($ftp_server) or die("could not connect to $ftp_server");
// login
if (@ftp_login($conn_id, $ftp_username, $ftp_password))
{
echo "Conectado a $ftp_username@$ftp_server\n";
}
else
{
echo "Não foi possível conectar com $ftp_username\n";
}
$file = $_FILES["uploadedfile"]["name"];
$remote_file_path = "/var/www/html/teste/".$file;
ftp_put($conn_id, $remote_file_path, $_FILES["uploadedfile"]["tmp_name"], FTP_BINARY);
ftp_close($conn_id);
echo "\n\nConexão encerrada";
?>
Ahhh man. Thank you very much. Solved my problem. kkk the arquivoi was like a bullet to another server.
– WebCraft