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

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -