I'm trying to get base64 out of the resized image but running readFile gives me this error:
Error: ENOENT: no such file or directory, open 'file:/data/data/com.app/cache/1472039430399.JPEG'(…)
any idea why?
@fgrs are you sure that the URI is supposed to only start with file: instead of file://? Can you access the same URI using native Java code?
RNFS.readFile(resizedImageUri.replace('file:/', ''), 'base64').then((base64) => {
did the trick, looks like returned path is wrong should start with data/data/...
@fgrs ok, so then this is not an issue with RNFS I assume :) Feel free to reopen if you still think that we can do something here.
@johanneslumpe I have the same issue. I use .replace('file:/', '') but when file has spaces like: "Introdution to Java.pdf" the error appears again. Any solution?
@sergiocloud try to replace it like:
path.replace(/%20/g, '\ ')
Works for me.
Most helpful comment
@johanneslumpe I have the same issue. I use .replace('file:/', '') but when file has spaces like: "Introdution to Java.pdf" the error appears again. Any solution?