Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Cannot Reproduce
-
3.5.0
-
None
-
Android
Description
I am using the the camera plugin:
Below is the code to demonstrate what I am trying to achieve:
pictureSource=navigator.camera.PictureSourceType;
destinationType=navigator.camera.DestinationType;
navigator.camera.getPicture(onPhotoURISuccess, onFail,
{ quality: 50, destinationType: destinationType.FILE_URI, sourceType: pictureSource.PHOTOLIBRARY });
function onPhotoURISuccess(imageURI) {
alert(imageURI);
// returns 'content:///123456'
window.resolveLocalFileSystemURL(imageURI, function(fileEntry){
alert(fileEntry.toURL());
file_url = fileEntry.toURL();
// returns 'file:///image.jpg'
var options = new FileUploadOptions();
options.fileKey = "file";
options.fileName = file_url.substr(file_url.lastIndexOf('/') + 1);
// but the file transfer is not working, as the file uri is not in the formate of cdvfile://image.jpg as specified in the file transfer doc.
var ft = new FileTransfer();
ft.upload($scope.file_url, encodeURI(server_url), win, fail, options);
})
}
Camera image selector on success it is returning the wrong file url, please let me know how to fix this.