I am trying to download a file from my server but I keep getting errors. HTML <ion-button expand="block" (click)="download()">Download Files</ion-button> TS download() { const url = 'http://ccoulter12.lampt.eeecs.qub.ac.uk/api/files/5d248f949c71e.pdf'; const path = this.file.dataDirectory; const transfer = this.transfer.create(); transfer.download(url, path + 'myfile.pdf').then(entry => { const url = entry.toURL(); if (this.platform.is('ios')) { // this.document.viewDocument(url, 'application/pdf', {}); window.open(url); } else { this.fileOpener.open(url, 'application/pdf') .then(() => console.log('File is opened')) .catch(e => console.log('Error opening file', e)); } }); } Continue reading...