cordova - how to check file is exist or not in mobile sd card using javascript -
how check if excel file (.xlsx) exists on sd card on android using phonegap? if file exits, how import , export file contents through javascript?
first add cordova file plugin project.then use following code :
var reader = new filereader(); var filesource = <file path>; reader.onloadend = function(evt) { if(evt.target.result != null) { // if receive not null value file exists } else { // otherwise file doesn't exists } }; // going check if file exists reader.readasdataurl(filesource);
Comments
Post a Comment