Hi,
I want to save files to device storage and display them back in UI. Can anyone help me out with this ?
Hi,
I want to save files to device storage and display them back in UI. Can anyone help me out with this ?
what kind of “files”? .txt or .doc?
Basically anything, It can be .txt, .doc or even .pdf
See https://ionicframework.com/docs/native/file/. If you are deploying to iOS and android be aware that some directories are not available on all plattforms.
From your application you could scan this directory or even save the file metadata to a localStorage.
Not sure whether this is the right way to do. But I did something like this
Blockquote
let reader = new FileReader();
let filesrc;
reader.onload = function (loaded) {
filesrc = loaded.target.result;
context.fileTransfer.download(filesrc, context.file.externalRootDirectory + file.name).then(success => {
console.log(“File Copied” + context.file.externalRootDirectory);
context.file = context.file.externalRootDirectory + file.name;
}, error => {
console.log(error);
});
};