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

Original file path along with cache path. #434

Closed
naveen-aluri opened this issue Oct 7, 2020 · 7 comments
Closed

Original file path along with cache path. #434

naveen-aluri opened this issue Oct 7, 2020 · 7 comments
Labels
suggestion New feature or request

Comments

@naveen-aluri
Copy link

Please return the original file path along with the temp path.

@naveen-aluri naveen-aluri added the suggestion New feature or request label Oct 7, 2020
@miguelpruivo
Copy link
Owner

@NaveenAluri I'm sorry, but this isn't possible anymore and won't be, unless Android team change the way they handle files. As of now, there are two only approaches that I already described multiple times, you can check this answer.

If for some reason you still want to use the original path, you can try one of the previous versions of the plugin prior to 2.0.0 which does exactly that. However, have in mind that after Android SDK 30, it won't be possible at all and as of SDK 29, only works with useLegacyStorage = true flag.

@naveen-aluri
Copy link
Author

@miguelpruivo, Is there any possibility to return the original File URI atleast?

@miguelpruivo
Copy link
Owner

miguelpruivo commented Oct 8, 2020

@NaveenAluri yes that’s possible. I didn’t include it because I don’t really think it will be useful for a Flutter app and could let people to misuse it. How are you planing to use?

@naveen-aluri
Copy link
Author

@miguelpruivo, actually my requirement is, need to allow to pick the file from different folders with the same file name, but I have seen your code that you are storing the selected files in the cache folder. So it is not allowing to upload the different files with the same name.

@miguelpruivo
Copy link
Owner

@NaveenAluri I don't believe that File URI will help you there then. You can try one of the previous versions before 2.0.0. Those won't cache files and return the original instead, however, won't work for SDK 30, have in mind.

@naveen-aluri
Copy link
Author

@miguelpruivo, yeah I tried to access the file path with URI but it doesn't support some folders like Downloads, it won't help at all.
And selecting the file from different folders with the same file name is an edge case scenario. So I'm going with the plugin as it is.

Thanks for this amazing plugin @miguelpruivo

@miguelpruivo
Copy link
Owner

miguelpruivo commented Oct 8, 2020

@NaveenAluri I'm sorry that I can't help you any further. If you wish to make it persistent, just move/copy the files into your app's directory files (using path_provider) and then delete the cache files immediately using cleanTemporaryFiles() from file_picker. That way you will keep a single persistent copy of that file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants