i'm using php facebook api 4.0. i'm using below code post photo on timeline.
facebooksession::setdefaultapplication($app_id, $app_sc); $helper = new facebookredirectloginhelper($url_page); $loginurl = $helper->getloginurl(); $session = new facebooksession($access_token); facebooksession::enableappsecretproof(false); if($session) { try { $response = (new facebookrequest( $session, 'post', '/me/photos', array( 'source' => '@' . realpath('1.jpg'), 'message' => 'message' ) ))->execute()->getgraphobject(); // if you're not using php 5.5 or later, change file reference to: // 'source' => '@/path/to/file.name' echo "posted id: " . $response->getproperty('id'); } catch(facebookrequestexception $e) { echo "exception occured, code: " . $e->getcode(); echo " message: " . $e->getmessage(); } }
but i'm getting exception occured, code: 324 message: (#324) requires upload file
error. think 1 thing that, fileupload support should set on. don't know should turn on.
Comments
Post a Comment