How do I download an excel/csv file dynamically generated on node js server?


I have a requirement where in whenever a user clicks on download button on the screen I generate a csv file on the server and send it back via response.
Now I want to download/open this dynamically generated file on my ionic app.
How can I do this? I haven’t used cordova plugins so far so no ideas on that front.

Can someone please guide me on this?

I have a same issue. Could you resolve?

Anyone have suggestions for exporting excel files?


Anyone found the solution for this. Suggests any idea. Thanks

The below might be helpful:

var targetPath = serverService.getDownloadLocation() + "attendance_" + todayStr +".xlsx";
				    var trustHosts = true
				    var options = {};

				    $, targetPath, options, trustHosts)
				      .then(function(result) {
				        console.log('File download successful');
				      }, function(err) {
					        console.log('File download failed');
					        throw err;
				      }, function (progress) {
					      	console.log('inside progress '+ progress.loaded);
					        //$timeout(function () {
					         // $scope.downloadProgress = (progress.loaded / * 100;

Simply inject the $cordovaFileTransfer plugin