2015-10-09 29 views
-1
FB.login(function(response) { 
          if (response.authResponse) 
          { 

           FB.api('/me/photos', 'post', 
          { 

           url:'http://test.xyzfoodservices.com/wp-content/plugins/facebook_login/single.jpg' 

          }, function(response) { 
           if (!response || response.error) { 
            console.log(response.error); 
            console.log(response); 
           } else { 
            alert('Success: Content Published on Facebook Wall'); 
           } 
          }); 
          FB.api('/me/picture?type=normal', function(response) { 

          var str="<figure class='tint'> <img id='img' src='"+response.data.url+"'/></figure>"; 
          document.getElementById("popUpDiv").innerHTML+=str; 
          }); } else 
           { 
          console.log('User cancelled login or did not fully authorize.'); 
           } 
          },{scope: 'email,user_photos,user_videos'}); 

我已經成功地從Facebook訪問。但是當我嘗試在用戶牆上發佈圖像時facebook javascript 324需要上傳文件。我測試了許多代碼和解決方案,但沒有幫助我。所以請回答一些不同的解決方案,因爲我已經嘗試過在OverFlow上提供的解決方案。 在此先感謝。使用Javascript API發佈圖像錯誤324需要上傳文件

+3

[感謝您告訴我們。祝你好運!](http://stackoverflow.com/help) – PeeHaa

回答

1
FB.api(
"/me/photos", 
"POST", 
{ 
    "url": "{image-url}" 
}, 
function (response) { 
    if (response && !response.error) { 
    /* handle the result */ 
    } 
} 
); 
+0

也嘗試自己的第一件事,然後問這裏尋求幫助。您可以在此尋求幫助,但不要爲您編寫完整的代碼。它的stackoverflow.com規則 –

+1

@OP:打開FB,登錄....發佈它。這很簡單。看起來你並沒有自己嘗試任何東西 –

相關問題