How to get real file path from URI

When we use the activity starter component, sometimes we get the location of a file using the Result.Uri.

This Result.Uri looks like this:

content://media/external/images/media/23989

But as we see, this does not indicate the actual location of the file.

In order to obtain the real location of the file we use the Taifun file extension App Inventor Extensions: File | Pura Vida Apps

This extension has a block that allows to obtain the path of a file from Uri

contentUri

With this block we will obtain the real location of the file.

We get something like this:

/storage/emulated/0/Pictures/IMG_20190912_213723.jpg

Sounds like a simple thing. But I’ve been trying for two days to get the real location of the file.

Now that I got it, I wanted to share it.

4 Likes

I have shown this on App Inventor, so see here (there is also an aia to download):

Try this to set Player.Source from Uri to Path :
https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!searchin/mitappinventortest/puzzle$20anke$20chris|sort:date/mitappinventortest/Tkdxn5XI8uA/R3BbCU_AAwAJ

Try this:

uri_path_imagePicker.aia (6.0 KB)