1

I have a problem in uploading photo into server which is taken by camera. I have tried to used the code in Mosync site but it doesn't work.

In the sample code below, 
my app always return "Could not upload photo - error: 3"



app.uploadPhoto = function(fileURL)
{
    var options = new FileUploadOptions();
    options.fileKey = "file";
    options.fileName = fileURL.substr(fileURL.lastIndexOf('/') + 1);
    options.mimeType = app.getMimeType(options.fileName);
    options.params = null;

    var transfer = new FileTransfer();

    transfer.upload(
        fileURL,
        "http://dev.mosync.com/mobilelua/PhotoGallery/upload.php",
        function(result)
        {
            alert("Photo uploaded");
        },
        function(error)
        {
            alert("Could not upload photo - error: " + error.code);
        },
        options);
};
Edrich
  • 232
  • 2
  • 8

0 Answers0