file_copy to remote site

  1. /**
  2.  * Copy a file from one site to another.
  3.  *
  4.  * Error I get "The selected file files/Snap1.png could not be uploaded, because the destination  is not properly configured."
  5.  */
  6. $path = 'files/Snap1.png';
  7. $result = file_copy($path, 'http://example.com/files/test.png');