내가하고 싶은 일은 페이스 북에 앨범을 만들고 앨범에 사진을 업로드하는 것입니다. 이제 페이스 북에 앨범을 만들 수 있지만 사진을 앨범에 업로드 할 수 없습니다. 앨범 ID를 얻을 수없는 이유는 모르겠지만, 어떤 해결책이나 아이디어? 여기 왜 Facebook 앨범 ID를 가져올 수 없습니까?
는<?//At the time of writing it is necessary to enable upload support in the Facebook SDK, you do this with the line:
$facebook->setFileUploadSupport(true);
//Create an album
$album_details = array(
'message'=> 'name',
'name'=> 'name'
);
$create_album = $facebook->api('/me/albums', 'post', $album_details);
//Get album ID of the album you've just created
$albums = $facebook->api('/me/albums');
foreach ($albums["data"] as $album) {
//Test if the current album name is the one that has just been created
if($album["name"] == 'name'){
$album_uid = $album["id"];
}
}
//Upload a photo to album of ID...
$photo_details = array(
'message'=> 'test'
);
$file='http://scm-l3.technorati.com/11/12/30/59287/google-logo-682-571408a.jpg'; //Example image file
$photo_details['image'] = '@' . realpath($file);
$upload_photo = $facebook->api('/'.$album_uid.'/photos', 'post', $photo_details);
//print_r($upload_photo);
?>
감사
을 앨범을 만들고 페이스 북에 사진을 업로드 내 코드입니다
문제입니다 ..? –
나는 album_id를 얻습니다. 문제는 지금 앨범 – Oscar