Hi guys. I want to read a docx file inside my src (or even assets. no mattar) in runtime. this is my function:
const loadTemplate = async (readFile) => {
try {
let contents = await readFile({
path: "./template.docx",
directory: FilesystemDirectory.Data
//encoding: FilesystemEncoding.UTF8
});
console.log(contents);
return contents;
} catch (e) {
throw e;
}
};
readFile function is destructed from useFilesystem() destructed from ‘@ionic/react-hooks/filesystem’.
it says Error: File does not exist.
How can I open binary file located in my project?