2

Is there a way to send image to a facebook user's wall? To publish texts I use this code:

$arpost = array(
            'message' => $text,
            'access_token' => $token
        );

        $ch = curl_init();

        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($arpost));
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_HEADER, 0);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

        $result = curl_exec($ch);

        curl_close($ch);

For future generations: http://developers.facebook.com/docs/reference/api/post/ <- param is called picture, so you do it like this:

$args = array(
        'message' => $text,
        'picture' => $link2picture
    );

    $this->_facebook->api('/me/feed/', 'post', $args);
marek
  • 259
  • 8
  • 19
  • Under that link, there's no advice dealing with my problem... And the link in the topic directs to an old solution. I use graph api. – marek May 13 '11 at 14:29

1 Answers1

0

Here is a link to doing it in Java... perhaps you can use it for some ideas.

Android - Upload photo to Facebook with Facebook Android SDK

Check the facebook php sdk too. It should be there.

https://github.com/facebook/php-sdk/

Community
  • 1
  • 1
Anthony Graglia
  • 5,355
  • 5
  • 46
  • 75