Possible Duplicate:
Facebook new javascript sdk- uploading photos with it!
I've had great success with the JS Graph API, and this is my first hang up.
This code does NOT work to save a photo, but it does save an album.
function saveImage() {
FB.api("/me/albums", "post", {
message:"album message",
name: "name of album"
}, function(response) {
console.log(response.id) // id of album, yes?
FB.api("/99999999/photos", 'post', {
message:"hji",
source: "@http://url/to/image/markz.png"
}, function(response) {
console.log(response)
});
});
It does create an album, but saving an image gives me the error: message: "(#324) Requires upload file"
I've tried it without the @ in front of the source. I've tried many variations including providing the auth token in the sending object. I have successfully saved an image via a curl in the terminal.
- I have permission to update_stream
- I'm authenticated
- I have thoroughly search the internet and read a plethora of PHP blogs how they do it in PHP.