Picking a file from a subfolder inside downloads folder returns wrong path
el-Knix opened this issue · comments
Describe the bug
If you select a file that is inside a subfolder inside the downloads tab, pickit returns path of the file without the subfolder name.
Can it be reproduced in demo app
Yes
PickiT version
0.1.14
Device information
- Huawei Mate 20 Pro
- 29
Please provide a screenshot of the demo application after selecting a file in a subfolder in Downloads.
@el-Knix I think this issue is not about pickIt SDK. I'd the same issue what actually happens is when we use download file function path is reference to "Download" directory what i did was i just point my directory to "Download/MY_FOLDER_NAME" and it worked
@el-Knix
I was able to reproduce this. The only way I can work around this is to check for the msf:
protocol and copy the file to your apps directly.
@Ammarulhaq
Can you please elaborate on what you mean with:
i just point my directory to "Download/MY_FOLDER_NAME"
@HBiSoft That's the work around I'm currently using. Not ideal but I guess there's no choice.
I've made the necessary changes and will implement it into the library tomorrow.
It will now first check for the msf:
protocol, then check if the file is available in the Downloads directory, if not it means it's in a subdirectory inside the Downloads directory and gets copied into the applications directory.
I will keep looking for ways to do it without copying the file, but in the meantime this will have to suffice.
Thanks Mate that will have to do...Great work on the library!
@HBiSoft
Just tested, seems to work great kudos.
Just one issue, the filename seems to be lost with this method since the proc path only has a number. Any idea on how we can get the filename from the /proc/ path?
@el-Knix
You will have to make use of the original Uri
that gets returned from MediaStore
.
Here's how I do it inside the library:
PickiT/pickit/src/main/java/com/hbisoft/pickit/DownloadAsyncTask.java
Lines 131 to 153 in 81e4601