php - Upload Photo To Album with Facebook's Graph API -


i'm trying familiarize myself facebook's new graph api , far can fetch , write data pretty easily.

something i'm struggling find decent documentation on uploading images album.

according http://developers.facebook.com/docs/api#publishing need supply message argument. i'm not quite sure how construct it.

older resources i've read are:

if has more information or me tackle uploading photos album using facebook graph api please reply!

here various ways upload photos using php facebook graph api. examples assume you've instantiated $facebook object , have valid session.

1 - upload default application album of current user

this example upload photo default application album of current user. if album not yet exist created.

$facebook->setfileuploadsupport(true); $args = array('message' => 'photo caption'); $args['image'] = '@' . realpath($file_path);  $data = $facebook->api('/me/photos', 'post', $args); print_r($data); 

2 - upload target album

this example upload photo specific album.

$facebook->setfileuploadsupport(true); $args = array('message' => 'photo caption'); $args['image'] = '@' . realpath($file_path);  $data = $facebook->api('/'. $album_id . '/photos', 'post', $args); print_r($data); 

Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -