File download from server using FileTransfer is not working

ts file

import { FileTransfer, FileTransferObject } from '@ionic-native/file-transfer';
import { File } from '@ionic-native/file';
export class SessionDetail {

constructor(
		private transfer: FileTransfer, 
		private file: File, 
	){}
download(fileUrl:any) {
	const fileTransfer: FileTransferObject = this.transfer.create();
	const url = fileUrl; // http://domain.com/file.pdf
	fileTransfer.download(url,this.file.dataDirectory).then((entry) => {
	console.log('download complete:url ' + entry.toURL());
	}, (error) => {
		
	});
}
}

No error shows. I was tried in android device. I am missing something…

Hi @ismailcse11,

Have you resolved this?

Try specify a full file path as the target, eg.:

fileTransfer.download(url, this.file.dataDirectory + "file.pdf").then(...

Thanks for reply. I have already solved.