views:

13

answers:

1

Hi all,

I'm pulling photos from albums on a facebook business page through the api and displaying them on a tabbed app on the same page - everything works as expected, I get urls to the photos that look like this:

http://photos-f.ak.fbcdn.net/hphotos-ak-snc4/hs689.snc4/
62916_492131547984_50574932984_6933281_3552549_a.jpg

Now if I try and display them like this on the tab app:

<img src="http://photos-f.ak.fbcdn.net/hphotos-ak-snc4/hs689.snc4/
62916_492131547984_50574932984_6933281_3552549_a.jpg">

Facebook renders it into this:

<img src="http://platform.ak.fbcdn.net/www/app_full_proxy.php?
app=167021599978776&amp;v=1&amp;size=o&amp;cksum=f044f3b409714034a653fe22d0d574c0&amp;
src=http%3A%2F%2Fphotos-f.ak.fbcdn.net%2Fhphotos-ak-snc4%2Fhs689.snc4%2F
62916_492131547984_50574932984_6933281_3552549_a.jpg">

which displays a broken image (i.e. nothing). Also, I get:

Failed to load resource: the server responded with a status of 403 (Forbidden)

for

app_full_proxy.php.

I have a workaround where I call the image from my server, i.e. I have a script

<?
$img = $_REQUEST['img'];
$data = file_get_contents($img);
header('Content-Type: image/jpg');
echo $data;
?>

that I call like so:

http://www.myserver.com/FB/tab/img_pass.php?img=$curr_img

where $curr_img is the url to the photo gained from the api call. This works, but I would like to know if anyone has an idea how I can display the image directly without this workaround or if anyone has some insight on the 403 message described above.

Thanks in advance,

JD

A: 

If you know photo id then you can use <fb:photo> FBML tag.

serg
Thanks; I know the photo id but I would like to use the image as a css background like background-image:url('http://photos-f.ak.fbcdn.net/hphotos-ak-snc4/hs689.snc4/62916_492131547984_50574932984_6933281_3552549_a.jpg') which runs into the problem described above.
John Doeherty

related questions