我照片上传到Facebook页面相册使用以下网址Facebook的照片上传到网页相册
<form id ="uploadForm" method="post" enctype="multipart/form-data">
<h4>UPLOAD PHOTO</h4>
<fieldset>
<input id="name" type="text" />
</fieldset>
<fieldset>
<textarea id="photoDtls"></textarea>
</fieldset>
<fieldset>
<input name ="source" type="file" />
</fieldset>
<input type="submit">
</form>
而且我用下面的JavaScript SDK代码
FB.getLoginStatus(function(response) {
if (response.status === 'connected') {
accessToken = response.authResponse.accessToken;
$('#uploadForm').attr('action','https://graph.facebook.com/photos/*page_album_id*?access_token='+accessToken);
});
} else if (response.status === 'not_authorized') {
alert('not autherized');
FB.login(function(response){
alert('Permission granted');
},{scope: 'email,user_birthday,publish_stream,photo_upload'});
} else {
alert('not logged in');
// the user isn't logged in to Facebook.
}
});
我得到的回应时,我上传该照片,但我没有看到照片上传到我的相册。有没有办法通过以下ID或ID后检查照片?这里可能出了什么问题?
{
"id": "xxxxxxxxxxxxxxxxxxxxx",
"post_id": "xxxxxxxx_xxxxxxxxxxxxx"
}
当您访问Facebook上的id或post_id时,您会看到什么?像www.facebook.com/ - 有你的照片吗? –
Jurik
https://graph.facebook.com/_post-id_给我'{ “错误”:{ “消息”: “不支持GET请求。” “类型”: “GraphMethodException”, “代码”: 100 } }' –
你使用这个例子:https://developers.facebook.com/blog/post/498/?我有一个类似的问题,但它与PHP - 因为我需要将图片保存在服务器上,以及:http://stackoverflow.com/questions/7340949/is-it-possible-to-upload-a-photo-没有发布 - 它有图像'图像'而不是'源'的名字。 – Jurik