I have a cache of pictures in my website, and I need to upload these photos to my Facebook fan page 4-5 times a day. My code creates an album and also uploads the photos to the album, however, these photos do not appear in the timeline.
So my question is, how do I upload photos to my fan page such that they appear on the timeline, on the wall. The language in use is PHP
Any help is greatly appreciated.
Thanks
Edit 1: Here is the code:
<?php
require 'facebook.php';
$facebook = new Facebook(array(
'appId' => "AAAAAAAAAA",
'secret' => "BBBBBBBBBB",
));
$fanpage_token = "ZZZZZZZZZZZZZZZZZZZZZZZZZZ";
$facebook->setFileUploadSupport(true);
//Create an album
$album_details = array(
'message'=> 'test album',
'name'=> 'album'
);
$create_album = $facebook->api('/PAGE_ID/albums', 'post', $album_details);
$album_uid = $create_album['id'];
echo $album_uid;
$img = '7newx.jpg';
$args = array(
'message' => 'Random message',
'image' => '@' . $img,
'aid' => $album_uid,
'no_story' => 1,
'access_token' => $fanpage_token
);
$photo = $facebook->api($album_uid . '/photos', 'post', $args);
?>