Reputation: 4187
Hi i want to know how can i get the link to the profile picture in facebook
<img src="https://graph.facebook.com/me/picture?type=large&access_token=<?php echo $params['access_token'] ?>"/>
is automatically converted into a link (When i right click on the image and property the .JPG link is given (Below) )
https://fbcdn-profile-a.akamaihd.net/hprofile-ak-ash2/573939_100000564553314_108738462_n.jpg
How could i get the 2nd link directly instead of using graph.facebook.com/me/picture.... link ?
Upvotes: 0
Views: 241
Reputation: 28470
With FQL:
SELECT pic FROM user WHERE uid = me()
Selecting 'pic' will return the CDN URL to the medium-sized profile picture for the user being queried.
You can change 'pic' to 'pic_small', 'pic_big' or 'pic_square' depending on the size you want. Detailed descriptions of each are available on the FB Developer pages
Upvotes: 0
Reputation: 43816
/me?fields=picture&type=large
- will return the image as a text response instead of a HTTP redirect - note that the FBCDN URL could conceivably change at some point, so don't assume it's static
Upvotes: 2