-
Notifications
You must be signed in to change notification settings - Fork 46
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
FileNotFoundException in Android 11 #44
Comments
removing
|
current |
Interesting report, thank you. Did you try enabling Do you also have an alternative idea on how to obtain the file name? |
Yes the We were still not aware of how the proper workaround using cursor currently 🙏 and still use the above approach instead. |
For the filename, we're using our own Kotlin extension to get the filename from Uri. Lemme paste it here later (still afk) |
This is a hackish ways though, we assume the last index as a file name from the suffix "/". Any better suggestions? In Java I think it's a little bit verbose than Kotlin version |
Too bad, thanks for clarifying!
I can see that this works for simple file selections, but might break when wanting to upload a file shared from another app. In this cases, the URI might be I do not spend much time developing for Android these days, so I am not sure if there exists another approach for getting the filename. If not, it would be the best solution to just leave the filename empty if we get an FileNotFoundException. This way, the error is handled as gracefully as we can. Would you be interested in a PR for this? |
Will check the alternative ways to get the filename via cursor gracefully for Android 11 above, and then hopefully will submit the PR around end of month or early next month 🙏 |
Thank you! Looking forward to your contribution :) |
https://twitter.com/yrezgui/status/1405194690811596808?s=19 There's a modernstorage library by Google, something to look for after the release. Because it's a tus-android is it okay to coupled with the android-related library? 🙏 |
Definitely! The modernstorage library definitely looks promising! Thanks for sharing
Yes, exactly. tus-android-client is meant to contain Android-specific code :) |
https://developer.android.com/about/versions/11/behavior-changes-11
The text was updated successfully, but these errors were encountered: