开发者

Post image to Facebook fan page with PHP SDK

I am trying to upload a image to my fan pages wall using the PHP SDK, and also let other people upload pics to the page.

Here is what I have thus far,

PHP:

$img = realpath($y);

$facebook->setFileUploadSupport("http://" . $_SERVER['SERVER_NAME']);

$photo = $facebook->api('/FAN_PAGE_ALBUM_ID/photos', 'POST',
    array(
        'access_token'  => $token,
        'source'        => '@' . $img,
        'message'       => 'This photo came from my app.'
    )
);

When I try th开发者_StackOverflowat nothing happens, even though I used a similar method to post to the fan pages wall, which worked fine, I also have the appropriate permissions, as far as I know... status_update,publish_stream,user_photos,offline_access ??

Any reason why this could be happening?


For you to be able to upload pictures to a page you are an administrator of, you would most likely need manage_pages permissions. I'm not sure you can have users upload pictures to a fan page from the graph api, although they can from the website so they should be able to.


You need this permission: manage_pages.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜