itinance / itinance/react-native-fs

The RFNS.readFile is not work as expected.

Open
#550 10 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
5k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

The RFNS.readFile is not work as expected. To make sure that the files exists, i first check if with the method (RNFS.exists), and it returns true, I also check stat (RNFS.stat), and returns the objects, but when I use readFile and encode to base64 it returns a giant string that isn't a base64 file. It was working fine on react-native 0.48, and the problem started after I upgrade to react-native 0.56.

var b64data = await RNFS.readFile(imagem, 'base64').then();

I need to use the b64data, but I'm facing the error. The string is 20x bigger than normal. I also check using base64 decode, and there's no characters images found.

"dependencies": {
...
"react-native": "0.56.0",
"react-native-fs": "^2.11.15",
...
}

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.