将图像链接保存到我服务器上的文件时遇到困难? [关闭]

I want to be able to save a link such as

example.com/get.php?id=4

I want to be able to save this link as an image on the server?

this is so that i can send the temp file to facebook api to upload it to the users profile :)

Thanks

$img = file_get_contents("example.com/get.php?id=4");
file_put_contents("temp_photo.jpg",$img);

of course you may have to add some validation.

Other option is to use CURL to download the image . Then you can upload the downloaded image to FB.

If your question is how to take a screen snapshot of a web page displayed in a browser, the manual way to do it is to use Firefox and the FireShot add-on.

After you have installed Firefox and Fireshot:

  • Surf to the URL
  • Right click on the web page
  • Menu will come up
  • FireShot >> Capture Entire Page And...
  • Save