Link to home
Start Free TrialLog in
Avatar of rAfridi
rAfridi

asked on

How to post picture at facebook news feed

Hello Sir

I want to upload any file at facebook news feed option.Means when i upload any file at server from my website that time it shall also upload at facebook news feed section.Then please guide to me how to do this.
Regards,
Aasim afridi
Avatar of roynaufal
roynaufal

check the fb development references:
u need the php sdk
https://github.com/facebook/php-sdk/

u need to create an application inside ur fb account

then use this javascript code , assuming u have already connected to facebook:

 public function postToWall($id, $message, $picture, $link, $name, $description) {
        try {
           $fb=new Facebook();
            $result = $fb->api("/$id/feed", "POST", Array(
                        'message' => $message,
                        'picture' => $picture,
                        'link' => $link,
                        'name' => "your app name",
                        'description' => $description
                    ));
            return true;
        } catch (FacebookApiException $e) {
            return false;
        }
    }
ASKER CERTIFIED SOLUTION
Avatar of rAfridi
rAfridi

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
did you first implement the 'connect with facebook' feature ?
where you can login to the site using facebook, it's a button you click, then a window from facebook opens up where you enter your facebook username/password afterwhich you allow your application to access your facebook info
Avatar of rAfridi

ASKER

Best