RNFetchBlob.fs .readFile(uri, 'base64') .then(data => { RNFetchBlob.fs .writeFile(uri, data, 'base64') .then(() => { console.log('FILE CREATED!!'); }) .catch(error => { console.log(error.message); throw error; }); }) .catch(error => { console.log(error.message); throw error; });
WARN Possible Unhandled Promise Rejection (id: 0):Error: Failed to create parent directory of 'file:///data/user/0/com.imagecrop/cache/rn_image_picker_lib_temp_b9f9d3e8-1434-4e53-b2e3-867db53ddaa4.png'Error: Failed to create parent directory of 'file:///data/user/0/com.imagecrop/cache/rn_image_picker_lib_temp_b9f9d3e8-1434-4e53-b2e3-867db53ddaa4.png' at promiseMethodWrapper (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.imagecrop&modulesOnly=false&runModule=true:2043:45) at writeFile (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.imagecrop&modulesOnly=false&runModule=true:96019:42) at anonymous (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.imagecrop&modulesOnly=false&runModule=true:95466:48) at tryCallOne (/root/react-native/ReactAndroid/hermes-engine/.cxx/Release/43l2p1y5/x86_64/lib/InternalBytecode/InternalBytecode.js:53:16) at anonymous (/root/react-native/ReactAndroid/hermes-engine/.cxx/Release/43l2p1y5/x86_64/lib/InternalBytecode/InternalBytecode.js:139:27) at apply (native) at anonymous (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.imagecrop&modulesOnly=false&runModule=true:26200:26) at _callTimer (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.imagecrop&modulesOnly=false&runModule=true:26119:17) at _callReactNativeMicrotasksPass (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.imagecrop&modulesOnly=false&runModule=true:26149:17) at callReactNativeMicrotasks (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.imagecrop&modulesOnly=false&runModule=true:26312:44) at __callReactNativeMicrotasks (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.imagecrop&modulesOnly=false&runModule=true:2407:46) at anonymous (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.imagecrop&modulesOnly=false&runModule=true:2219:45) at __guard (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.imagecrop&modulesOnly=false&runModule=true:2391:15) at flushedQueue (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.imagecrop&modulesOnly=false&runModule=true:2218:21) at invokeCallbackAndReturnFlushedQueue (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.imagecrop&modulesOnly=false&runModule=true:2212:33)
I get such an error. i want to save the image in the file to the gallery, but I can't see the image in the file, so I want to save it to the phone's gallery.