You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "John D. Ament" <jo...@gmail.com> on 2012/03/29 22:03:00 UTC

Attempting to upload a picture taken to a JAX-RS server

All,

Using your examples, I built a simple app that is meant to take pictures
and upload them via jax-rs.  My javascript looks like this (based on one of
your examples)

        function uploadPhoto(imageURI) {
            var options = new FileUploadOptions();
            options.fileKey="file";
            options.fileName=imageURI.substr(imageURI.lastIndexOf('/')+1);
            options.mimeType="image/jpeg";
            /*
            var params = new Object();
            params.value1 = "test";
            params.value2 = "param";

            options.params = params;
            */
            var ft = new FileTransfer();
            ft.upload(imageURI, "http://dev.internal.com/barcode/r/upload",
win, fail, options);
        }

It ends up reporting back a failure, with error code 3.  I don't see any
indication that the data was sent up to the server.  Is there anything else
I can use to troubleshoot?  The android console logs don't indicate any
failures either.

John