我正在创建一个在Facebook上发布照片的应用。使用我的代码我收到此错误:
{“error”:{“message”:“(#324)需要上传文件”,“类型”:“OAuthException”,“code”:324}}
我知道登录正常....但上传后给我这个错误......
有人可以帮我吗?
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'});
}
});
}
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'});
}
});