I'm creating an app to publish photos in Facebook. With my code I receive this error:
{"error":{"message":"(#324) Requires upload file","type":"OAuthException","code":324}}
I know that the login is ok....but after the upload give me this error...
Someone can help me please?
ciaopoint2.Globals.imagefinal = 'data:image/jpg;base64,'+canvas.toDataURL("image/jpg");
//Verifico lo Stato del Login
FB.getLoginStatus(function(response) {
if (response.status === 'connected') {
var uid = response.authResponse.userID;
var accessToken = response.authResponse.accessToken;
FB.api(
'/photos',
'POST',
{
message: 'CiaoPoint ti ringrazia',
source: ciaopoint2.Globals.imagefinal
},
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
}
else {
FB.login(function(response) {
if (response.authResponse) {
FB.api(
'/photos',
'POST',
{
message: 'CiaoPoint ti ringrazia',
source: ciaopoint2.Globals.imagefinal
},
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
}
else {
alert("Non puoi loggarti in Facebook");
}
}, {scope: 'email'});
}
});