Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 229617

File Transfer plugin image download get corrupted

$
0
0

Hi,
I am using file transfer plugin to download images in my app. There are many images to be downloaded.
In iOS the images are fine, but in android tablets the images get corrupted after download and is fine in android phones.

async downloadtabletimages(article_tablet , id){
	try {
    	const fileTransfer: FileTransferObject = this.pdfDownload.create();
    	const url = article_tablet;
    	const target = this.file.dataDirectory + "article_mobile" + id + '.jpg';
    	await fileTransfer.download(url,target).then((location) => {
    		this.database.executeSql('INSERT INTO Article_tablet VALUES(?,?)', [ id  , JSON.stringify(location.nativeURL)]);
    	});
  	} catch (error) {
  	}     	
}

This is my code to download images.
Any suggestions are appreciable.

Thanks.


Viewing all articles
Browse latest Browse all 229617

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>