I’m using the code as documented on the ngCordova site but I’m unable to read a file as text. There no mention of what the filePath variable should contain.
In my case I’m trying to read the URL the camera returns as Camera.DestinationType.FILE_URI, being in the following format: file:///var/mobile/Containers/Data/Application/98BDEB32-05E5-43A0-ACF4-FCF5E15E4605/tmp/cdv_photo_023.jpg
Looks like a good file path to me and can even use that path to show the image in the cordova app, but I can’t read the file as text (and need it to create an md5 hash of the image)
Any help is greatly appreciated!
// Reads a file as TEXT
$cordovaFile.readFile(filePath).then(function(result) {
// Success!
}, function(err) {
// An error occured. Show a message to the user
});