jaiselrahman / FilePicker

FilePicker library for Android
Apache License 2.0
238 stars 70 forks source link

No way to get file path. #54

Closed carotkut94 closed 3 years ago

carotkut94 commented 4 years ago

As in the latest build 1.3.2 , getPath is deprecated, and we now have to use getUri but, in order to get the file path from uri , none of the methods available on internet works. So whats the way to get the file path.

Marc-Ferrer-Castillo commented 4 years ago

This works for me:

ArrayList<MediaFile> files= data.getParcelableArrayListExtra(FilePickerActivity.MEDIA_FILES);
 files.get(0).getPath();
carotkut94 commented 4 years ago

but then getPath is deprecated in favour of gerUri thus, and on sdk 29+, getPath return null

Marc-Ferrer-Castillo commented 4 years ago

I am using sdk 29 and it works, have you tried: android:requestLegacyExternalStorage="true"

NSR88 commented 4 years ago

I have tried that too, but its unluckily not working in Android 10, returning null for getPath(). Till Android 9 (that is, Pie), its working fine.

tcs-developer commented 4 years ago

i am also facing same issue. even i used your suggestion but no use.

MahmoudMabrok commented 4 years ago

so we should return back to geturi

MahmoudMabrok commented 4 years ago

i have two device with android 10 one of them i can pick a file with path {xiaomi with android one } second one, get null {Samsung A6 }

DkKhan786 commented 4 years ago

Same issue did you get any solution..?

DharmeshMTechnolab commented 3 years ago

I have same issue in Android 10 device if you have any solution please give me

arzakmiftakhul commented 3 years ago

I can get file using Uri on android 10 by following this answer