Save files to device storage ionic


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 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

let reader = new FileReader();
let filesrc;
reader.onload = function (loaded) {
filesrc =;, context.file.externalRootDirectory + => {
console.log(“File Copied” + context.file.externalRootDirectory);
context.file = context.file.externalRootDirectory +;
}, error => {