Ciao, sto sclerando da giorni per copiare dei file dallo stesso ftp server tra due directory diverse.
Codice PHP:
<?
//FTP
//Connect to the FTP server
$ftpstream = @ftp_connect('localhost');
//Login to the FTP server
$login = @ftp_login($ftpstream, 'user', 'pass');
if($login) { //We are now connected to FTP server.
//Create a directory on your website and set permission where needed
@ftp_mkdir($ftpstream, $destpath);
ftp_site($ftpstream,"CHMOD 0777 $destpath");
$file = $sourcepath . 'index.php';
$fp = fopen($file, 'r');
//Upload the temporary file to server
@ftp_fput($ftpstream, $file, $fp, FTP_ASCII);
}
//Close FTP connection
ftp_close($ftpstream);
Il vaore di $sourcepath è preso con realpath(".")... dove sbaglio? Tra l'altro non ho nessun errore di ritorno sul server! :-( (sarà qualche settaggio del php.ini?).
Il file da copiare dovrebbe finire sotto la nuova cartella creata $destpath (che viene creata correttamete)
?>