views:

187

answers:

1

I am trying to upload an image through my application with Facebook Graph API to an album of my fan page. Although I provide the albumID like a parameter for uploading the image, it is uploaded in an album named APPLICATION_NAME Photos on my own profile. The album of the fan page stays empty. I tried also with sending the pageID of my fan page instead of albumID, but the result is the same. The code I use for the upload is:

$fb_pfoto = $facebook->api('/' . $albumID . '/photos','POST',array(
       'access_token' => $session['access_token'],
       'message'      => 'Caption',
       'source'       => '@' . realpath( '/path/to/image.jpg' )
    ));

Please give me ideas how can I upload the image to the fan page and not to my own profile album.

+1  A: 

Don't know if this would help but maybe you need to request manage_pages extended permission and then use returned page access_token for posting pictures. You can read briefly about this process here.

Then you can try these links with page access token for posting photos:

/me/photos
/<page_id>/photos
/<album_id>/photos
serg
Thanks very much for the answer. From what I read from your link, this permission allows me to access user's fan page. What I need to achieve is to upload the content to one single fan page which is administrated by me.
o15a3d4l11s2