I need to save dataURL pdf file in phone's directory in Android using Cordova with ngCordova.My code is Given below:-
var dataURL="data:application/pdf;base64,JVBERi0xLjMKJf////8KNiAwIG9iago8PAovVHlwZSAvRX...";
$cordovaFile.createFile(cordova.file.externalRootDirectory,dataURL, true)
.then(function (success) {
alert('success');
}, function (error) {
alert('Fails');
});
It not working.I need to save PDF in dataURL format using Cordova Android.How to do it.
Check this code
var dataURL="data:application/pdf;base64,JVBERi0xLjMKJf////8KNiAwIG9iago8PAovVHlwZSAvRX...";
$cordovaFile.writeFile(cordova.file.externalRootDirectory,'filename',dataURL, true)
.then(function (success) {
alert('Download Completed. Check your Internal/External Storage..');
}, function (error) {
alert('Fails');
});