I am facing problem upload file from camera and gallery.
When selecting few images from gallery I am able to successfully upload the image to WCF service. Thus WCF service is working fine and so is the code to upload file and also same code works with emulated web camera also.
However when selecting a few images from gallery I am getting *error code *
java.io.FileNotFoundException: http://www.foobar.com/sasas
JavaScript Code
function selectImageFromCamera(){
var popover = new CameraPopoverOptions(300,300,100,100,Camera.PopoverArrowDirection.ARROW_ANY);
var options = { quality: 49, destinationType: Camera.DestinationType.FILE_URI,sourceType: Camera.PictureSourceType.CAMERA, popoverOptions : popover};
navigator.camera.getPicture(this.uploadPhoto, this.onFail, options);
}
function selectImageFromGallery(){
var popover = new CameraPopoverOptions(300,300,100,100,Camera.PopoverArrowDirection.ARROW_ANY);
var options = { quality: 49, destinationType: Camera.DestinationType.FILE_URI,sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY, popoverOptions : popover};
navigator.camera.getPicture(this.uploadPhoto, this.onFail, options);
}
function uploadPhoto(imageURI) {
var serverUrl = "http://www.foobar.com/safafa";
var image = document.getElementById("imgUpload");
image.style.display = "block";
image.src = imageURI;
var fileUploadOptions = new FileUploadOptions();
fileUploadOptions.fileKey="file";
fileUploadOptions.fileName=imageURI.substr(imageURI.lastIndexOf('/')+1);
fileUploadOptions.mimeType="image/png";
fileUploadOptions.chunkedMode=true;
var ft = new FileTransfer();
ft.upload(imageURI, serverUrl, this.win, this.fail, fileUploadOptions);
}
Please help me to identify What I am doing wrong.