Copy files server to server
When I am new in buy and sell web site business my biggest problem is transfering the content of my site from my server to my customer server.
May be you’re thinking that is not really a problem, you need only to download the site content then upload them to other server. Yes that what I did before, but don’t you think the time you will consume downloading 500 MB or higher content of site in to your computer then upload it again to other server?
So I decided to make some research and make expirement until I come up with a script that I can use as my personal file transfer script.
You can get this script and use for your personal use and hope it will works with you too.
| <?php set_time_limit(0); $HOST=”"; //eg tips1001.com $UN=”"; //your user name $PW=”"; // your password $DIR=”"; //directory where to copy $conn = ftp_connect($HOST); if(!ftp_login($conn,$UN,$PW)) { ftp_quit($conn); ftp_chdir($conn,$DIR); echo “<p>Current directory is ” .ftp_pwd($conn); $files = ftp_nlist($conn,”.”); for($i=0;$i<count($files);$i++) { if(!ftp_get($conn,$files[$i],$files[$i],FTP_BINARY)) { ftp_quit($conn); |





You must be logged in to post a comment.