反应本机文档选取器uri以获取rael路径get



如何获取react原生文档选择器uri以获取rael路径

react本机文档选取器res=--大小:76711名称:"IMG-20200420-WA0000.jpg"类型:"image/jpeg"uri:"content://com.android.providers.media.documents/document/image%3A551098">

但我希望uri的路径类似路径:"/storage/emulated/0/DCIM/Camera/IMG2020419175011.jpg或可以在服务器上上传

react原生真实路径将对此有所帮助。

RNGRP.getRealPathFromURI(image.path)
.then(filePath => {
let data = convertToFile(
filePath.substring(filePath.lastIndexOf("/") + 1),
image.path
);
this.isImageUriOrNot = false
this.setState({
imageData: data,
imageUri: { uri: image.path },
loadCameraScreen: false,
});
})

最新更新