我照片上傳到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