Error am getting OAuthException: (#100) picture URL is not properly formatted
I have got a very strange problem,I am able to upload pictures on my page album using graph api,but when i try to post a picture using graph api,it is not working,
Note when i post a message or a link to wall,its getting posted,the problem is only with the picture.
Here i am putting both the code snippets:
1,This is when i am trying to upload a picture to page album(working):
$facebook->setFileUploadSupport("http://apps.facebook.com/pagecron");
$x=realpath($_FILES['source']['tmp_name']);
$parameters = array('message' => $_POST['message'],'source' =>'@' . $x );
$parameters['access_token'] = $_SESSION['active']['access_token'];
$check=$facebook->api('/'.$_SESSION['active']['id'].'/photos/','POST',$parameters);
2,This is when i am trying to post a picture to the wall(Not Working):
$img = realpath($y);
$facebook->setFileUploadSupport("http://apps.facebook.com/pagecron");
$x=realpath($_FILES['source']['tmp_name']);
$parameters = array('message' => $_POST['message'],'picture' =>'@' . $x );
$parameters['access_token'] = $_SESSION['active']['access_token'];
$check=$facebook->api('/'.$_SESSION['active']['id'].'/feed/','POST',$parameters);