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

    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 04, 2013 4:21 PM

Answers

  • 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.

    --Rob

    Wednesday, December 04, 2013 11:13 PM
    Owner