The usual way as I post messages to my page wall is like:
$args = array(
'access_token' => $page_access_token,
'message' => $title,
'link' => $link,
'name' => 'This is title',
'description' => 'This is a testing of the posting on page',
//'picture' => 'http://www.example.com/directory/images/30.jpg'
);
$post_id = $facebook->api("/$pageId/feed","post",$args);
But how can I post an images to my wall – the alternative to: click to UPLOAD button, pick out an image -> and upload, image is on to wall.
I have on my FTP some images and these ones I would like to upload to my wall.
Thanks in advance
https://developers.facebook.com/blog/post/498/ this link can help you…
Here are some various ways to upload photos using the Graph API. The examples assume you’ve instantiated the $facebook object and have a valid session.
1 – Default Application Album of Current User
This example will upload the photo to your default application album of the current user. If the album does not yet exist it will be 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 – Target Album`
This example will upload the photo to a 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);