You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tested and found fb.api for "/me/feed" works perfectly in node.js server. But when I tried to use the graph api for "/me/photos" as mentioned in http://developers.facebook.com/docs/reference/api/album/, I got the error. That is because it expects the source to be in "multipart/form-data". But in my case I am getting the file in server in tmp filesystem. How can I get it in "multipart/form-data" ? I am using "'connect-form'" with express to get the data from client to server and it gets saved as /tmp/files...
..............
app.post('/', function(req, res, next){
req.form.complete(function(err, fields, files){
if (err) {
next(err);
} else {
fb.apiCall('POST', '/me/photos',
{access_token: fields.access_token, message: fields.message, source:files.source},
function (error, response, body) {
if (error) {
console.log('Error in facebook Photo UPLOAD', error);
return;
}
console.log('facebook RESPONSE :', response);
console.log('facebook BODY :', body);
res.redirect('back');
//res.render('done', {body: body});
}
);
}
});
The text was updated successfully, but these errors were encountered:
Hi,
I tested and found fb.api for "/me/feed" works perfectly in node.js server. But when I tried to use the graph api for "/me/photos" as mentioned in http://developers.facebook.com/docs/reference/api/album/, I got the error. That is because it expects the source to be in "multipart/form-data". But in my case I am getting the file in server in tmp filesystem. How can I get it in "multipart/form-data" ? I am using "'connect-form'" with express to get the data from client to server and it gets saved as /tmp/files...
..............
app.post('/', function(req, res, next){
req.form.complete(function(err, fields, files){
if (err) {
next(err);
} else {
});
The text was updated successfully, but these errors were encountered: