2
votes

as we know that to get a profile picture we use this url (graph.facebook.com/1700278611/picture) but when i want to store it in database it is not working can anybody tell me how to save that image in database as we know this url (graph.facebook.com/1700278611/picture) redirect to this url (http://profile.ak.fbcdn.net/hprofile-ak-snc4/hs222.ash2/48814_1700278611_949486_q.jpg) so pls help thanks in advance

1

1 Answers

4
votes

You can just store img_url as graph.facebook.com/FB_USER_ID/picture in database. In your webpages, you can simply use that URL like <img src="http://graph.facebook.com/FB_USER_ID/picture" /> to display the image.

You do not really need to know the "real" image URL. In-fact, that may eventually get defunct if user delets or changes his profile image. So, real image URL may not be advantageous. On the other hand, the symbolic URL provided by graph API will always point to the latest user image.