我正在尝试使用脸谱图
将图像上传到页面ablbum$facebook->setFileUploadSupport(true);
$args = array('message' => 'Photo Caption',
'source' => '@' . realpath(ABSPATH.$image_realpath)
, 'access_token' => $page_access_token);
$data = $facebook->api('/'. $album_id . '/photos/', 'post', $args);
print_r($data);
但它给了我这个例外
Fatal error: Uncaught OAuthException: (#240) This user isn't allowed to upload photos to this object's wall
我是该网页的管理员,我向我的应用添加了manaege_pages
,publish_stream
,share_item
,offline_access
权限,但仍然遇到此问题
答案 0 :(得分:0)
尝试在应用设置中设置范围(权限):' manage_pages '
试试这个:
$DestinationFile = 'images/filename.jpg';
$newImagePath = "@" . realpath($DestinationFile);
$response = $facebook->api(
'/me/photos/', 'post', array(
'access_token' => $facebook->getAccessToken(),
'message' => 'This is an awesome tech website : http://www.technew.in ' ,
'source' => $newImagePath
));
print_r($response);