-
Notifications
You must be signed in to change notification settings - Fork 712
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
Path string returned by saveFile() on Android does not resolve to the actual selected file path #1590
Comments
I'd be curious if they couldn't just modify the file pick function since assumably it has to get the full path to the file to be able to either A) copy it to memory B) read the contents to memory or C) action on it? Saving is effectively the same just instead of returning just the full path you can manually set a file name, which that part works fine. Honestly even if actually saving the file doesn't work, i would think in most cases so long as you have the path+filename you should be able to write to it via other means |
@deathblade666 but probably there is some platform specific shenanigans |
No stranger than if you were to pick a file, you'd just have to add additional actions to do what you want with it (dart io should be able to handle any file system actions provided a correct path). Though, the primary issue here is that the returned path is incorrect, however the return path when picking a file (pickFiles()) is correct, so my thought is why not use the same logic for both. Since outside the bytes flag they are effectively doing the same thing, just one offers a "save as" dialog instead of a select file dialog. |
This issue is stale because it has been open for 7 days with no activity. |
issue still actual and there were no changes after |
This issue is stale because it has been open for 7 days with no activity. |
This issue was closed because it has been inactive for 14 days since being marked as stale. |
It seems to be an old bug, but the bot keeps closing it. |
Before creating an issue, make sure that you are on the latest
file_picker
version and that there aren't already any similar opened inssues. Also, check if it isn't described on the Wiki, specially on Troubleshooting page.Also, sometimes a simple
flutter clean
andflutter build
again with latest file_picker version, may end up by fixing cached issues, so I encourage you to first do so.Describe the bug
This is reopening of the #1553, because bot closed it, but nobody looked into it.
When using the
saveFile()
method of the file picker, the returned string path is different from the actual picked file location. It will always be inside the Download folder.Platform
Platform OS version
14 (API 34)
How are you picking?
Details to reproduce the issue
Provide all the details to reproduce the issue.
Flutter Version details
Additional context
The android implementation of
saveFile
usesEnvironment.DIRECTORY_DOWNLOADS
, sosafeFile
will always return the path to the downloads directory.flutter_file_picker/android/src/main/java/com/mr/flutter/plugin/filepicker/FilePickerDelegate.java
Lines 91 to 92 in 8bbe066
if nobody knows for now, how to resolve this issue, then as a hack, is it possible to use
saveFile
method without dialog?The text was updated successfully, but these errors were encountered: