给予足够的文件上传权限后,照片未上传到 Facebook 相册中……我还参考了有关图形 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);