-1

I want to download an images from its source to my server(dedicated path) as a background processing.(without message box to user who uses my web application.)Actully all i am doing is importing pictures from social site(Fb,twitter,gmail etc).And show them in that paricular user gallery.Is it possible to download as background processing ,without the notice of browser/user to save that image and store it in given path and later on display on the user gallery. Can code igniter download library can be used as background processin or are there other ways of doing so?

I am using Win OS,Xampp,and code igniter Thanks.

ugene
  • 551
  • 1
  • 7
  • 19

1 Answers1

1

run the following in the BG using AJAX:

//Get the file
$content = file_get_contents("http://www.google.co.in/intl/en_com/images/srpr/logo1w.png");
//Store in the filesystem.
$fp = fopen("/location/to/save/image.jpg", "w");
fwrite($fp, $content);
fclose($fp);

From this SO post: PHP - Copy image to my server direct from URL

Community
  • 1
  • 1