This is a discussion on ftp to ftp within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Bonjour, I have online one ftp(ftp1) and other web update on ftp (ftp2). I need to transfert any file ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Bonjour,
I have online one ftp(ftp1) and other web update on ftp (ftp2). I need to transfert any file from ftp1 to ftp2 via php page (on serveur ftp1). here my code but the transfert don't work (login ftp is ok). i dont' see what's problem. Thanks /******************************************/ <? $ftp_server = 'ftp.xxxxx.com'; $ftp_user_name = 'xxxx'; $ftp_user_pass = 'xxxxx'; $source_file="\\home\\xxxx\\xxxx\\fichier\\file.ra r"; $destination_file= "\\home\\xxx\\fichier\\"; // connexion $conn_id = ftp_connect($ftp_server); // login and pass $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); // Vérification de la connexion if ((!$conn_id) || (!$login_result)) { echo "Login FTP failled!"; echo "Logon at $ftp_server with $ftp_user_name\n"; die; } else { echo "Logon at $ftp_server, with $ftp_user_name\n"; } /* // download file $upload = ftp_get($conn_id, "$destination_file", "$source_file", FTP_BINARY); // Vérification de téléchargement if (!$upload) { echo "download Ftp failled!\n"; } else { echo "download is ok frome $source_file onr $ftp_server en $destination_file\n"; } */ // close ftp ftp_close($conn_id); ?> /************************************************** **********/ |