react-native-fs
react-native-fs copied to clipboard
RNFS.stat reports file not exists, but RNFS.exists reports file exists.
The code that call RNFS.stat (version 2.9.11) works.
But after I upgrade RNFS to the latest version, and RNFS.stat always run into exception, says file does not exists.
My sample code:
let path='file:///data/user/0/com.fzbdemo8/cache/1531620707190.JPEG'
RNFS.stat(path).then(
(stat)=>{}
).catch((err) => {
console.log(err.message, err.code); //run into exception
});
The file do exists.
I meet this problem too,please help .how to fix it
I'm having this problem too. Can someone help?
I check the code,and then add this line File file = new File(filepath);
String originalFilepath = getOriginalFilepath(filepath);
// File file = new File(originalFilepath);
File file = new File(filepath);
if (!file.exists()) throw new Exception("File does not exist");
WritableMap statMap = Arguments.createMap();
then I got this result
{path: "/storage/emulated/0/Android/data/*****", ctime: Thu Jul 19 2018 14:17:05 GMT+0800 (中国标准时间), mtime: Thu Jul 19 2018 14:17:05 GMT+0800 (中国标准时间), size: 430392, mode: undefined, …}
I think there is some wrong with this line
File file = new File(originalFilepath);
Yes, also having this issue. However it cannot be reproduced on 2.9. Seems like https://github.com/itinance/react-native-fs/pull/480 has broken something.
Any fixes or update on this issue. For file:// its working but for file:/// its not working
Your URL in your path may contains chinese. I solved it by following code: let filePath = decodeURIComponent(res.uri);
I used react-native-document-picker. Returned uri(file path) contains Chinese characters.
same on 2.10.14, any solution?
Same issue here, I can't get the real path from a URI Running Android react-native-fs -- version: "2.16.6"
Error: File does not exist
my URI es like: content://com.android.providers.downloads.documents/document/15
Are any updates on this?
Same error of @encubos. Any solution or workaround to resolve real path from URI?
Is this bug fixed? I have the same problem, thanks!
rn-fetch-blob works for me, ref to https://github.com/itinance/react-native-fs/issues/756#issuecomment-554937928