Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How to post picture at facebook news feed

Posted on 2010-11-23
4
560 Views
Last Modified: 2012-05-10
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
0
Comment
Question by:rAfridi
  • 2
  • 2
4 Comments
 
LVL 3

Expert Comment

by:roynaufal
ID: 34203369
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;
        }
    }
0
 

Accepted Solution

by:
rAfridi earned 0 total points
ID: 34203812
Dear sir,
Thanks for very soon reply
But i am facing one problem  when i am running this code it is giving "Permission denied error " .
I am tiring to  extend the permission but it is not taking .I am using this code to extends the permission


$uid = $facebook->getUser();

$api_call = array(
                  'method' => 'users.hasAppPermission',
                  'uid' => $uid,
                          'ext_perm' => 'publish_stream '
            );
            
            $can_post = $facebook->api($api_call);


Regards ,
Aasim Afridi
0
 
LVL 3

Expert Comment

by:roynaufal
ID: 34203841
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
0
 

Author Closing Comment

by:rAfridi
ID: 34459396
Best
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question