in my ionic project im saving the file in the www/pdf directory
when i m trying to open the file using ng-cordova for this plugin im getting file not found…
here is the latest version of the code
$cordovaFileOpener2.open(
"file:///android_asset/www/pdf/test.pdf",
'application/pdf'
).then(function(event) {
// file opened successfully
console.log(event);
}, function(err) {
// An error occurred. Show a message to the user
console.log(err);
});
First FileOpener2 has such a bad documentation. I don’t know why is it even included into ngCordova collection.
You CAN’T use it to open an assets content so forget about it. Files must be placed inside a real system directory.
It will not work if you don’t have a dedicated application for that file type. So make sure to check it before doing anything.