{ "error": { "message": "(#100) source is not properly formatted", "type": "OAuthException", "code": 100 } }
function postPicToFacebookWallAjax() { var authToken = $('#hfAccessToken').val(); var files = $("#flUpload").get(0).files; var fd = new FormData(); fd.append("source", files[0]); fd.append("access_token", authToken); fd.append("caption", "caption"); fd.append("message", "Test Message"); fd.append("name", "Name"); fd.append("description", "Description field"); var url = "https://graph.facebook.com/me/feed?access_token=" + authToken; try { $.ajax({ url: url, type: "POST", data: fd, processData: false, contentType: false, cache: false, success: function(data) { alert("success " + data); }, error: function(shr, status, data) { alert("error " + data + " Status " + shr.status); }, complete: function() { alert("Posted to facebook"); } }); } catch (e) { alert(e); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)