php - Saving a friend's Facebook picture to disk from the server does not work -
tl;dr
- viewing images friend's profile image album works on web page fb javascript api
- page passes url server, server cannot download image url (http status 0)
- user logged in both js api , php-sdk api , has fb photo permissions
- current profile images work great
- this issue not affect users, some.
my facebook photos app
my app creates video montage of friend's facebook images.
the app asks permissions:
- "user_photos"
- and "friends_photos".
the user chooses pictures add montage javascript in browser. pass url of chosen image server, downloads image url , stores on amazon s3.
everything works on client , always works friends profile images. other images i.e. ones album or previous profile pics, server cannot download image @ all.
using curl, status code returned 0. other images, code 200.
how can access these images? server need pass other data able access cdn images?
the image urls passed js long links , this: http://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-ash4/s720x720/408158_894440624792_192203432_41161655_469457024_n.jpg (this not real image link though)
i can open images in browser fine, cannot open them server-side.
i using php-sdk, server authenticated facebook logged in user. know correct have tried multiple accounts , checked current logged in user id.
to download, have tried curl, file_get_contents , couple of other methods. receive nothing, therefore don't think facebook giving server access picture.
strangely, issue seems affect users, not everyone.
also - server php 5.2 , running on iis.
any fantastic!
further info: tried visiting url when logged in user account, not friend of owner of photo , see image in browser. odd server cannot.
because issue occurs subset of facebook users, have feeling there may bug somewhere in way image permissions granted.
this means there slight discrepancy between js api , php api, images , users.
however, have adjusted code images way , no longer have issue.
Comments
Post a Comment