Hi all.
I have an issue that I dont understand.
In a page of my android app I copy a file to data directory:
const savedFile = await Filesystem.copy({
from: filename,
directory: FilesystemDirectory.Cache,
to: '421429.1629190715467.jpeg',
toDirectory: FilesystemDirectory.Data
});
const contents = await Filesystem.readFile({
path: '421429.1629190715467.jpeg',
directory: FilesystemDirectory.Data,
});
All works fine. I correctly get the content of the file copied.
Now I want to load this file from another page.
The code is quite simple
testReadFile(filename){
const contents = Filesystem.readFile({
path: '421429.1629190715467.jpeg',
directory: FilesystemDirectory.Data,
}).then(
(content) =>{
console.log('check existing file ' + JSON.stringify(content));
}
).catch(e =>{
console.log('check existing file ' + e.message);
});
}
but I always get “File not found”
What I’m doing wrong?
thanks
1 post - 1 participant