I am trying to upload selected file. but when I select the file from recent file section I am getting different path like
content://com.android.providers.media.documents/document/document%3A1000007352
this.
I want path as below:
/storage/emulated/0/Download/template.xlsx
but I always want exact path where file is stored. I get proper path if I go in folders and select that file but I want to select file from recent section
I tired few ways to get real path but I failed. so I tried different approach:
after getting uri, I checked if file has extension.
If file has no extension, then get file name as below
then save file temporarily in internal file storage using uri and display name
after sending temporarily saved file to api, delete temp file
p.s. this is an alternative way I found and it worked perfect for my situation, although your welcome to give answer to the question.