【发布时间】:2013-02-11 17:48:55
【问题描述】:
在给予足够的文件上传权限后,照片未上传到 facebook 相册中......我也参考了有关 graph api 的相关问题,但仍然没有成功......
$facebook->getLoginUrl(array('scope' => 'user_status,publish_stream,user_photos,photo_upload,can_upload'));
$album_details = array(
'message'=> 'Testing Description For Pic',
'name'=> 'Testing Pic Album'
);
$create_album = $facebook->api('/me/albums', 'post', $album_details);
$args = array(
'message' => 'Photo from application',
'image' => '@'.$imgURL
);
$url = 'http://graph.facebook.com/'.$create_album['id'].'/photos?access_token='.$aut_key;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $args);
$data = curl_exec($ch);
【问题讨论】:
标签: php facebook facebook-graph-api