Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Absolute or full file path returns blank/empty string #89

Closed
Dhaval3344 opened this issue Apr 18, 2022 · 4 comments
Closed

Absolute or full file path returns blank/empty string #89

Dhaval3344 opened this issue Apr 18, 2022 · 4 comments
Labels
wontfix This will not be worked on

Comments

@Dhaval3344
Copy link

Library version: 1.3.0
OS version: [Android 11]
Device model: [Google Pixel 4a]

I pick the image and try to get the image absolute path but not working, please check the below code:
filePath = DocumentFileUtils.getAbsolutePath(files.get(0), requireContext())

Using the above line path gets blank, check below attach SS.

Screenshot 2022-04-18 161547

@anggrayudi
Copy link
Owner

Retrieving absolute path on scoped storage is useless. Even though you have success to get the path, you can't do anything because scoped storage allows file management with URI only. Please read FAQ File path returns empty string

@Dhaval3344
Copy link
Author

Hello @anggrayudi
Thanks for the quick reply,

For me, retrieving the absolute path is not useless, if is it possible another way it's better for me and other users otherwise this library is ......

Please let me know if possible absolute path.

Thanks.

@anggrayudi
Copy link
Owner

anggrayudi commented Apr 19, 2022

I can't understand why people forcing me to make this library works with direct file paths. This library is just a wrapper for the scoped storage APIs. I have mentioned in the FAQ that it is not the library limitation, but the operating system itself. So, if you want to make your app works well with direct file paths (java.io.File), you only have 3 options:

  1. Request full disk access. Read: Manage all files on a storage device
  2. Ask Google to remove the scoped storage restrictions.
  3. Try to create a pull request to Android Open Source Projects. Perhaps your PR will be approved by Google.

I did many research in writing this library. It is a trash for people who don't understand how scoped storage works. You can search other libraries that manage scoped storage like Simple Storage. Unfortunately, they report the same thing as I have faced.

@anggrayudi anggrayudi pinned this issue Apr 19, 2022
@anggrayudi anggrayudi added the wontfix This will not be worked on label Apr 19, 2022
@anggrayudi anggrayudi changed the title Absolute or full file path return blank. Absolute or full file path returns blank/empty string May 4, 2022
@Tanzin01
Copy link

Well, this scoped storage is trash...... so is shitty ggle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants