Posted By

ginoplusio on 01/16/10


Tagged

php remote copy


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

jimdam
netzwerktourist
ginoplusio


Copy remote JPG on your site with PHP


 / Published in: PHP
 

URL: http://www.barattalo.it/2010/01/16/copying-remote-files-on-your-server-with-php/

Used to copy the user avatar from Facebook to your community in this Facebook Connect Tutorial.

  1. function copyFile($url,$filename){
  2. $file = fopen ($url, "rb");
  3. if (!$file) return false; else {
  4. $fc = fopen($filename, "wb");
  5. while (!feof ($file)) {
  6. $line = fread ($file, 1028);
  7. fwrite($fc,$line);
  8. }
  9. fclose($fc);
  10. return true;
  11. }
  12. }

Report this snippet  

You need to login to post a comment.