I have a Cordova/PhoneGap app which uses the camera to capture a picture. I need to access this picture to send to my server.
For Android I simply use $cordova
I was struggling with a similar issue for a while, but I figured it out today. I also thought that the FileSystem APIs didn't work with assets-libary://
URIs -- but that is not the case.
You should be able to get access to the File object (as well as the actual image name) by using the following code:
resolveLocalFileSystemURL('assets-library://asset/asset.JPG?id=711B4C9D-97D6-455A-BC43-C73059A5C3E8&ext=JPG', function(fileEntry) {
fileEntry.file(function(file) {
var reader = new FileReader();
reader.onloadend = function(event) {
console.log(event.target.result.byteLength);
};
console.log('Reading file: ' + file.name);
reader.readAsArrayBuffer(file);
});
});
I had success with a simple substitution, like this
fullPath = fullPath.replace("assets-library://", "cdvfile://localhost/assets-library/")
It works in iOS 9.3