I have a hybrid, functional application using Phonegap. My problem now is to send the image obtained from within the app to an external server.
This is the code for capturing image using a Cordova plugin.
capturePhoto: function(){
navigator.camera.getPicture(onSuccess, onFail, {
quality: 50,
destinationType: Camera.DestinationType.DATA_URL,
correctOrientation: true,
saveToPhotoAlbum: true
});
function onSuccess(imageData) {
$.post( "http://www.exemplo.com/api/upload.php", {data: imageData}, function(data) {
alert("Image uploaded!"+ data);
});
}
function onFail(message) {
alert('Failed because: ' + message);
}
}