-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
unable to get actual path of the file #12
Comments
Could you elaborate about which functions you are talking specifically? |
It does not Provide the actual path of the file. Suppose we have a file present in "/storage/emulated/0/dcim/camera/test.mp4" so it provide us the path "content://media/external/video/1234" Which is not actual path. Is there is any way to get the actual path of the file?. |
A short answer is getting the direct path of the file is not possible, and even if it is possible, you would probably end up not being able to actually read or modify it. I suggest you start here with familiarizing youself with a concept of Android Scoped storage and ContentProvider/ContentResolver contract, along with Content URIs that they use to communicate. For that I would read through this section of Android documentation, with all subarticles https://developer.android.com/guide/topics/providers/content-providers To put it shortly for your case, if you want to modify a file, you would need to open it with a file descriptor from ContentResolver, using Content URI (and not an actual file URI, which you don't know and shouldn't need to know), and then modify it via file streams. Unfortunately, exposing this API in a Flutter plugin is a rocket-science level effort, so I have chosen to not implement yet. It doesn't mean that this isn't possible, but I would rather implement it when there is an actual demand for it and concrete use cases, to better design a solution for it. Link to the part of the file APIs in ContentResolver that I have chosen to not expose The only thing that is implemented is a file API inside ContentProvider, because it doesn't require too much effort to implement for a most common use case. If you have suggestions on how this API could be exposed, I would be glad to read through that. |
Hello Dear Developer, first of All thanks for develop such a great package. But it just give us the content path. How can we get the exist file, to perform different operations over it?
The text was updated successfully, but these errors were encountered: