I am created project Ionic with Sharepoint,
I have a stored pdf, xls, doc, etc.. file in list, I have a actual path of a file URL, I am create documents Gallery in my app with download option, when i'm click download icon i have to download a that particular document.
I have tried
file trasfer plugin
i can't achieve pls help me to solve this problem.
here my tried code.
file trasfer way:-
this.download("sample","https://abcd.sharepoint.com/samplesite/Shared Documents/sample.pdf");
download(fileName: string, filePath: any) {
const url= encodeURI(filePath);
const fileTransfer: FileTransferObject = this.transfer.create();
fileTransfer.download(url, this.file.externalRootDirectory + fileName, true).then((entry) => {
//show toast message as success
}, (error) => {
//show toast message as error
});
}
pls give some idea to download a file. Is there any other way is available to download a file using url in ionic3?