[WinJS] Post image to user's Facebook wall from my app RRS feed

  • Question

  • Hello everybody,

    I'm developing a Windows Store app using WinJS. I need to upload on Facebook a picture locally saved on my computer from my application.

    I'm using the facebook-winjs-sdk. The authentication process works well, I'm also able to post a text message on the user's Facebook wall, but I can't post a picture.

    The code I'm using is the following:

    FB.api('', 'post', {
                            batch: [
                                { method: 'post', relative_url: 'me/feed', body: 'message=' + encodeURIComponent(message), attached_files: 'myPicture' }
                            myPicture: myPicture.path
                        }, function (res) {

    I receive the error: "File 'myPicture' has not been attached".

    myPicture variable is correctly assigned, and so is its "path" property.

    Thanks in advance

    Wednesday, December 4, 2013 4:21 PM


  • Hi Podel0,

    Somebody from the community here may be able to help, but you might be better off checking with Facebook for help with their API.


    • Marked as answer by Anne Jing Friday, December 27, 2013 5:49 AM
    Wednesday, December 4, 2013 11:13 PM