tags:

views:

23

answers:

1

I am use following methods to upload photo :

$args = array('message' => 'Photo Caption');
$args['image'] = '@' . realpath($file);
$data = $facebook->api('me/photos', 'post', $args);
print_r($data);

After success to upload photo, $data return "Array ( [id] => 1.16874205038E+14 )". How can i access the photo on my apps?

A: 
echo sprintf('%s', $data['id']);

With sprintf you can ask php to treat long number as a string and after that you can work with that string as you wish.

$photo = $facebook->api(sprintf('%s', $data['id']));

This will return an array of your photo details. http://developers.facebook.com/docs/reference/api/photo

PS: i'm not sure if you need an implicit casting to string in this particular case, so you can try to get the $photo with or without sprintf.

zerkms
Hi zerkms, thank for your help, I am fix it by used normal facebook acc. But it still error on my facebook test acc.
hwy
what concrete error?
zerkms