React-native-fs: How to use getFileUri?

Created on 5 Apr 2018  路  4Comments  路  Source: itinance/react-native-fs

screen shot 2018-04-05 at 7 16 31 pm
How can I use getFileUri given in below link. I want to get the real path of the file.

https://github.com/itinance/react-native-fs/pull/395

I tried below code, but getting error:

        RNFS.getFileUri(uri).then(filePath =>
                alert(filePath);
              )

Most helpful comment

getFileUri is a native function not meant to be used at javascript level. It has been introduced to support the content uri in Android and it's internally used to read and write file. For example you can use a a filepath similar to content://downloads/tmpname with the usual methods like readFile, writeFile and copyFile.

All 4 comments

I'm getting the same error 馃檨

getFileUri is a native function not meant to be used at javascript level. It has been introduced to support the content uri in Android and it's internally used to read and write file. For example you can use a a filepath similar to content://downloads/tmpname with the usual methods like readFile, writeFile and copyFile.

@AgNm I've just sent #480 that expose the original file name pointed by the content uri, maybe this could be useful for you

I am still unclear on how to get back a uri from getFileUri. is there an code example of how to use it?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

npomfret picture npomfret  路  4Comments

1556173267 picture 1556173267  路  3Comments

opoze picture opoze  路  3Comments

zaheerahmad92001 picture zaheerahmad92001  路  3Comments

AbdelkaderOumrani picture AbdelkaderOumrani  路  3Comments