angularjs - Download only new files on an Ionic app? -
i want download file server if file new. example, checking file modified date. using below code download file, stuck need compare files before downloading. can please give me solution this.
.factory('filedownloadservice',['$cordovafiletransfer', function($cordovafiletransfer){ return{ filedownload:function(){ // file download var url = "http://www.xxxxx/file-to-download.json"; // file name var filename = url.split("/").pop(); // save location var targetpath = cordova.file.externalrootdirectory + filename; $cordovafiletransfer.download(url, targetpath, {}, true).then(function (result) { console.log('download successful'); }, function (error) { console.log('download error'); }, function (progress) { // progress handling }); } }}])
appreciate help. thank you
Comments
Post a Comment