So when I take pictures they get saved to DCIM/Camera/ directory. I need to retrieve the pictures after taken to send via email.
How can I get the name of the last picture taken? (Or adjust my current code to customize the file name.)
Here's the code for taking the picture:
function capturePhoto(id) {
navigator.camera.getPicture(onSuccess, onFail, { quality: 20,
destinationType: Camera.DestinationType.FILE_URI });
function onSuccess(imageURI) {
var image = document.getElementById(id);
image.style.display = 'block';
image.src = imageURI;
}
function onFail(message) {
alert('Failed because: ' + message);
}
}