Skip to content Skip to sidebar Skip to footer

How Do I Get The File Path From The Content URI For Video Files?

I want to attach images or video files from the Android storage. When I select a video from the gallery, it returns the content uri path. How do I get the file path with extension

Solution 1:

How to get the file path with extension?

You don't. There is no requirement that the user select a piece of content that is saved as a file in a place that you have read access to. And there is no requirement that a ContentProvider offer some means of translating a Uri to a file path.

Use ContentResolver and openInputStream() to read in the content identified by the Uri.


Post a Comment for "How Do I Get The File Path From The Content URI For Video Files?"