I am writing a little Facebook application and I would like to publish a picture and a link when the user selects a certain option. Its been hard to find good resources about specific API calls like this (most of the books I've find were from 2008 and seem outdated). Can anyone explain how I might do this (I would I assume I would do this with a php call). Also, if anyone knows any good literature or resources on this topic that are not out of date that would be very helpful.
Asked
Active
Viewed 2,980 times
-1
-
Are your referring to posting to Facebook walls? See duplicate: [stackoverflow.com](http://stackoverflow.com/questions/691425/how-do-you-post-to-the-wall-on-a-facebook-page-not-profile/3429737#3429737) – Lars Wiegman May 04 '11 at 21:53
-
namsral: that's not quite the same thing, he is talking about posting a message from an outside application. I am talking about posting an image from inside a Facebook application. – Mike2012 May 04 '11 at 22:11
-
Do you want to **upload** a picture or post it from an online **link**? – ifaour May 05 '11 at 07:32
-
I would prefer to upload a picture. – Mike2012 May 06 '11 at 18:03
1 Answers
1
Your answer is here: http://developers.facebook.com/docs/reference/api/post/
They give you a CURL example, and if you're familiar with PHP's curl api you can trivially replicate it.

Femi
- 64,273
- 8
- 118
- 148
-
-
1Ah, you clarified: you actually want the Javascript SDK. See http://developers.facebook.com/docs/reference/javascript/FB.api/. They give an example of posting directly to the stream using Javascript. There's a bunch of permission work you need to do to get that permission, but once you do that its pretty straightforward. – Femi May 04 '11 at 22:16
-
Thank you this was very helpful and I was able to post a link that included picture, but what I was really want is to post an image itself (instead of a link with an image associated with it). Sort of like when you upload a photo or facebook to a single album. I'll keep digging and thanks for all your help! – Mike2012 May 06 '11 at 20:06
-
Ah, posting to an album you unfortunately can't do from the javascript SDK: for that you really want one of the server SDKs, like PHP or Java. In Java land, I'd recommend RestFB (see http://restfb.com/) and there are a bunch of PHP SDKs available for you to use. – Femi May 06 '11 at 20:09