Download file from URL to a project folder in Ionic 2

Hi, I’m trying to use File Transfer to download a file from url to a folder in my project.

Example:

downloadImage() {
const fileTransfer = new Transfer();
let url = ‘https://www.w3schools.com/css/trolltunga.jpg’;
let path = ‘…/assets/img/’;
fileTransfer.download(url, path + ‘img.jpg’).then((entry) => {
console.log('download complete: ’ + entry.toURL());
}, (error) => {
// handle error
});
}

But this does nothing, neither throws any error. Any help?

Thanks :slight_smile: