I am trying to create replica of text file and rename it on ftp server.
I am aware of copy()
function of PHP
, but it not working on FTP
HERE IS MY CODE
$ftp_conn = ftp_connect($ftp_server) or die("Could not connect to $ftp_server");
$login = ftp_login($ftp_conn, $ftp_username, $ftp_userpass);
if ($login) {
$fn = 'folderName/f1.txt'; // This is the file whose replica i want to create as a f2.txt
$newfn = 'folderName/f2.txt';
if (copy($fn, $newfn)) {
echo "Done"
}else{
echo "Error";
}
}