Wednesday, November 18, 2009

How to upload the file from one server to Remote server?

$fileToBeUploaded = "filename.txt";

$source = fopen($fileToBeUploaded,"r");
$conn = ftp_connect("ftp.myserver.com");
ftp_login($conn,"","");

ftp_fput($conn,"/path_to_folder_on_remote_server/newfile.txt",$source,FTP_ASCII);

ftp_close($conn);

No comments: