I've used
'req_perms' => 'publish_stream,status_update'
The error I'm getting is
Fatal error: Uncaught CurlException: 26: failed creating formpost data thrown in facebook.php on line 589
My upload code:
$facebook->setFileUploadSupport(true);
$args = array('message' => 'My Friend\'s');
$args['image'] = '@' . realpath('http://mysite/img/img.jpg');
$data = $facebook->api('/me/photos', 'post', $args);
print_r($data);
I just want to upload the photo to an existing album or already created album. What would working code be?
Another code
$photo_details = array('message'=>$_REQUEST['arttitle'],'source'=> '@' . realpath( $_FILES[file]tmp_name]));
$facebook->api('/me/photos','POST',$photo_details);
results in
Fatal error: Uncaught OAuthException: (#324) Requires upload file thrown in facebook.php on line 522
I tried other answers from Stack Overflow, but none of them worked in my case.