views:

144

answers:

1

hello

i'm trying to post an image to my users's facebook wall once they hit a botton

i'm using javascript SDK but i have a problem, the image looks like a link in the wall ... but that's not what i want ... i want to post an image ... same as when you put an image link on your status text field and it turns to image

any help ?

FB.ui(
           {
             method: 'stream.publish',
             message: 'test',
             attachment :{ 
                    'name': 'i\'m bursting with joy', 
                    'href': ' http://bit.ly/187gO1', 
                    'caption': '{*actor*} rated the lolcat 5 stars', 
                    'description': 'a funny looking cat', 
                    'properties': { 
                        'category': { 'text': 'humor', 'href': 'http://bit.ly/KYbaN'}, 
                        'ratings': '5 stars' 
                    }, 
                    'media': [{ 
                            'type': 'image', 
                            'src': 'http://icanhascheezburger.files.wordpress.com/2009/03/funny-pictures-your-cat-is-bursting-with-joy1.jpg', 
                            'href': 'http://bit.ly/187gO1'}] 
                        },
             user_message_prompt: 'Share your thoughts about Connect'
           },
           function(response) {
             if (response && response.post_id) {
               alert('Post was published.');
             } else {
               alert('Post was not published.');
             }
           }
A: 

Try FB.api() method:

var wallPost = {
    message : "testing...",
    picture: "http://url/to/pic.jpg"
};
FB.api('/me/feed', 'post', wallPost , function(response) {
  if (!response || response.error) {
    alert('Error occured');
  } else {
    alert('Post ID: ' + response);
  }
});

You can get a list of supported wall post params here (see "Publishing").

serg
but is there a way to UPLOAD IMAGE TO USER WALL ?
From.ME.to.YOU
@From.ME.to.YOU well an image will be posted to a wall as an icon, not as a link. Is that what you need? What do you mean by upload?
serg