Images downloaded by app are not showing in <img> tag


#1

Hello everyone,

I’m having trouble to show images after they are downloaded with FileTransfer on my app.

fileTransfer.download(this.cars[i].img, cordova.file.dataDirectory + this.getFileName(this.cars[i].img))
        .then(
          (entry) => {
            this.debug.push({data: 'Download finish: ' + entry.toURL()});
            car.img_local = entry.toURL();
            console.log(entry)
            console.log(car)
            this.cars[i] = car;
            if (total_files == i) {
              this.storage.set('cars', this.cars);
              this.navCtrl.setRoot(DashboardPage);
            }
          }, (error) => {
            alert(JSON.stringify(error))
          });

I’m trying to show the images with the tag but they are not showing. I’m already using DomSanitizer but it’s still not working.

<img [src]="_DomSanitizer.bypassSecurityTrustResourceUrl(car.img_local)"  />

I’ve been looking all over the internet and didn’t find a good solution, and i think it may be very simple, since it’s just downloading and showing images from local storage. I hope somebody can help me.