2012-11-04 40 views
1

我知道你可以通過JS SDK提供的外部照片URL上傳照片到Facebook。但是,如何將本地託管的照片上傳到Facebook?如果我用我的IP地址,我仍然得到這個錯誤:上傳一個本地託管照片到JS SDK

"http://10.0.1.9:9914/media/images/templates/cover/851x315_FLAME.png is an internal url, but this is an external request 

代碼:

var data = array(); 
data['message'] = 'hello world'; 
data['url'] = 'http://10.0.1.9:9914/media/images/templates/cover/851x315_FLAME.png'; 

FB.api('/me/photos', 'post', data, function(response){ 
    if (!response || response.error) { 
     //alert('Error occurred'); 
    } else { 
     //alert('Post ID: ' + response.id); 
    } 
}); 

所有我想要的是能夠在本地上傳託管照片使用JS SDK去FB!請幫忙!

回答

1

同類問題here

iFrame上傳方式可能是您的最佳選擇,但如果您有空間做到這一點,那麼您可以在服務器端完成所有操作?