Use PHP to save a Facebook User’s Image

In this tutorial, I will show you a simple way to save a Facebook user's image to your server using PHP.

In many cases, you may need to save a Facebook user’s image to your server. It might be for an app on Facebook or some other reasons.
In the code below, we start with the Facebook user’s id. Next we set the image width and height.
The $fb_url is the actual path of the users image we will use to save the image.$fid/picture?width=$width&height=$height
Next is $img_save_location. This the location we want to save the Facebook user’s image.
And last, use file_put_contents function to get the image from the url and then save it.

I hope you find this useful for one of your projects.

Tagged with:

View all contributions by


Related Articles


Stay connected with us

Add us on Google+

Follow us on Facebook

Follow us on Twitter

Get updates via RSS

Get email updates


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">