Modeled from the (Facebook Javascript SDK), now with the facebook-node-sdk you can now easily write the same code and share between your server (nodejs) and the client (Facebook Javascript SDK).
Hello, I want to upload a picture to an album. Here is my code:
FB.api(folderId + '/photos', 'post', {"source": fs.createReadStream(filePath)}, function (res) {
if(!res || res.error) {
console.log(!res ? 'error occurred' : res.error);
return;
}
console.log('Post Id: ' + res.id);
});
In this case I get the error from facebook: (#324) Requires upload file.
Hello, I want to upload a picture to an album. Here is my code: FB.api(folderId + '/photos', 'post', {"source": fs.createReadStream(filePath)}, function (res) { if(!res || res.error) { console.log(!res ? 'error occurred' : res.error); return; } console.log('Post Id: ' + res.id); }); In this case I get the error from facebook: (#324) Requires upload file.