Cant read txt file on android device

var documents = fs.knownFolders.documents();
var myFile = documents.getFile("Test_Write.txt");

var written: boolean;
// Writing text to the file.
    .then(function () {
        // Succeeded writing to the file.

        // Getting back the contents of the file.
            .then(function (content) {
                // Successfully read the file's content.
            }, function (error) {
                // Failed to read from the file.
    }, function (error) {
        // Failed to write to the file.

to be able to read the file you to override it first that’s I find from searching and reading documentation the problem on that’s is you need to have content of the file to override it with it but I cant get it because I cant read it any idea or plugin can help read the file without need to override it


I’m able to write and read file with your same code.


yes its work but if you wanna read file you to ovveride it first then read it i dont have content of file to i be able to overide it then read it


you cant only just read file without overide it


I’m sorry man, not really getting what you mean by override it


mean you need to use writeText() to write the file then use readText() to read it but if you have file thats you didnt write with writeText() you want be able to read it and sorry for my english


You should be able to read any file.


thanks man for the help but its still not working its read files on the project directorys but its cant read files from android directory paths l


Can you please be more specific if you are trying to read a particular file. In case if you are trying to read a file from external storage, you have to first obtain the permissions.


i obtain permission and my file path 100% correct the problem is on fs module from whats i read on this
you cant only read just file you have to write then read