react-native - RNFS.exists 总是返回 false,即使图像存在于库中的反应本机
问题描述
我正在尝试在我的反应本机应用程序中检查我的移动存储中是否存在图像。但即使文件存在,它每次都会向我返回错误。我错过了什么吗?在此先感谢。
这是我的图像路径
file:///var/mobile/Containers/Data/Application/4B92ACDC-8DD1-4713-A841-CAFEBD180525/tmp/FB1923E6-A008-4B68-8B8D-6415F247EF59.jpg
代码
RNFS.exists(imagepath).then((val)=>{
if(val){
console.log("Exists");
}else{
console.log("Does not exits");
}
}).catch((error)=>{
console.log(error);
})
解决方案
推荐阅读
- python-3.x - how i can do some function after client's push inline keyboard button in telegram chat
- tensorflow - 使用 DeepExplainer 获取 Keras 中具有 tensorflow 后端的 MLP 模型的 shap 值
- react-native - ReactNative,使用 expo 裸工作流有什么好处?
- .net - 我需要用许多表映射一个复杂的类型关系
- google-apps-script - 如何使用 Google Docs 中的 google apps 脚本设置表格中一行的背景颜色?
- angular - Angular ValidatorFn returns, but does not block Form
- google-apps-script - 如何从各种工作表中的各种数据创建多个文件夹?
- c# - 无限递归尝试解析自定义 DI 容器中的类型
- javascript - HTML/CSS 性能:用于大型数据表的 flexbox 与表
- r - 跨数据框中的 3 列应用函数仅返回一列