我用 Sharepoint 创建了 Ionic 项目,
我有一个存储的 pdf、xls、doc 等文件在列表中,我有一个文件 URL 的实际路径,我在我的应用程序中创建带有下载选项的文档库,当我单击下载图标时,我必须下载那个特定的文件。
我努力了
文件传输插件
我无法实现请帮我解决这个问题。
这是我尝试过的代码。
文件传输方式:-
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
});
}
请给出一些下载文件的想法。有没有其他方法可以使用ionic3中的url下载文件?