简体   繁体   中英

Facebook Image URL is invalid (Graph API)

I am developing a Facebook game. In that the 10 opponent picture is displayed. I had saved these profile images in the database once the user had registered.

I am using PHP to echo the image, but the problem is some pictures are being displayed and others are giving me a '404' / '400' or 'Invalid URL ' not found error. Example: ( These images earlier used to be displayed but not anymore)

http://sphotos-a.ak.fbcdn.net/hphotos-ak-ash3/522851_116822898455075_142765921_q.jpg
https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc6/199347_134645999940053_5814468_q.jpg.
  1. How can I fix this problem? Or find some alternative so that the broken link of these images is not displayed.
  2. I am having the user ID of these users, Can I somehow generate new picture if these picture links

    are detected as broken?

  3. Is it advisable to hotlink the Picture URLs ? I don't want this problem to occur again?

I would appreciate if some one could help me.

您可以使用此网址来获取其FB用户ID的任何用户的个人资料图片

https://graph.facebook.com/<fb USER ID>/picture?type=large

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM