simple solutions for complex problems
Tips » Copying remote files and folder to remote folders through ftp and php
I spent a while looking for a way to make copies of remote files through ftp but to no avail.
Thankfully though, its pretty simple in php, observe:
<?
//Copy a remote folder
//Works on linux hosts
//Tell us where we are: for me returns /homepages/15/d10543/htdocs/newfolder
echo getcwd();
//Change new folder and old folder to what they need tobe, based on info from getcwd()
exec("cp -r /homepages/15/d10543/htdocs/oldfolder /homepages/15/d10543/htdocs/newfolder");
?>