Fix filename when saving a shared file#86
Merged
naveensingh merged 3 commits intoFossifyOrg:masterfrom May 21, 2025
Merged
Conversation
Previously, the code used the last path component of the content URI, but that isn't necessarily the filename -- it can be a numeric ID. Switch to the helper function getFilenameFromContentUri(), which uses ContentResolver to read the DISPLAY_NAME column. (If that fails, we fall back to the last component of the content URI as before, because we don't have anything better to use.) Also improve the way the MIME type is determined. Previously it was just based on the file extension. Switch to first query the ContentResolver, then try the type of the Intent (which is supposed to be set to the MIME type of the data for ACTION_SEND, but may be set to "*/*" if the type is unknown), and only then fall back to using the file extension. Fixes FossifyOrg#37.
6 tasks
|
Any news from the devs on getting this merged? This seems like a small change which fixes |
Member
|
It'll be merged before the next update, which is soon. |
|
On a related note, could there be a text input for choosing the final filename? The icon is a little misleading since it is labelled Thanks to the contributor and to you for maintaining Fossify. I really love these applications! |
Member
Yep, I'll see what can be done about that but feel free to raise it as a feature request :) |
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
From the commit message:
What is it?
Description of the changes in your PR
Testing
Tested on Android 8.1 and Android 14, sharing both using Fossify File Manager and using the native Files app.
For testing, see the branch 'build/fix-filename-from-sharing-debug' of my fork (commit), which logs all the values of interest (search for lines containing "XXX" in the logcat).
Fixes the following issue(s)
Acknowledgement