So I am working with this function, that works great...
but right now, it overwrites files on the remote website, and instead, I want it to ignore files that already exist...
function ftp_putAll($conn_id, $src_dir, $dst_dir) {
$d = dir($src_dir);
while($file = $d->read()) { // do this for each file in the directory
if ($file != "." && $file != "..") { // to prevent an infinite loop
if (is_dir($src_dir."/".$file)) { // do the following if it is a directory
if (!@ftp_nlist($conn_id, $dst_dir."/".$file)) {
@ftp_mkdir($conn_id, $dst_dir."/".$file); // create directories that do not yet exist
}
ftp_putAll($conn_id, $src_dir."/".$file, $dst_dir."/".$file); // recursive part
} else {
$upload = ftp_put($conn_id, $dst_dir."/".$file, $src_dir."/".$file, FTP_BINARY); // put the files
if (!$upload) echo 'FTP upload failed!';
echo ". ";
}
}
}
$d->close();
any tips would be great.