- /**
- * Transfer Files Server to Server using PHP Copy
- * @link https://shellcreeper.com/?p=1249
- */
- /* Source File URL */
- $remote_file_url = 'http://origin-server-url/files.zip';
- /* New file name and path for this file */
- $local_file = 'files.zip';
- /* Copy the file from source url to server */
- //$copy = copy( $remote_file_url, $local_file );
- $copy = file_put_contents($local_file, fopen($remote_file_url, 'r')); //lihat http://stackoverflow.com/questions/3938534/download-file-to-server-from-url
- /* Add notice for success/failure */
- if( !$copy ) {
- echo "Doh! failed to copy $file...\n";
- }
- else{
- echo "WOOT! success to copy $file...\n";
- }
https://shellcreeper.com/move-files-server-to-server-using-simple-php/