Implement file type validation to prevent unsupported uploads#6825
Implement file type validation to prevent unsupported uploads#6825Kota-Jagadeesh wants to merge 11 commits into
Conversation
|
tested the app with a mix of supported and unsupported files. verified that it successfully skipped the unsupported files and displayed a toast notification to inform the user Screenrecorder-2026-04-09-12-21-59-342.mp4 |
|
shared the same folder from the external gallery app : Screenrecorder-2026-04-09-12-26-58-883.mp4 |
|
Testing this PR with .heic: 0aea1b30-b9c4-495e-a422-6a73496616c0.mp4
|
|
@nicolas-raoul Thanks for testing. I have updated the PR with the suggestions above, please check it and lmk about the changes when you have time :) |
|
✅ Generated APK variants! |
nicolas-raoul
left a comment
There was a problem hiding this comment.
I have been using this branch for several weeks, it is working great and the other features still work as before.
| handleNullMedia() | ||
| } else { | ||
| //Show thumbnails | ||
| // Filter the files using the correct property |
There was a problem hiding this comment.
Can you make that comment more understandable to someone who is not familiar with the context?
| <string name="license_cc_by_sa_long_description">This license allows reusers to distribute, remix, adapt, and build upon the material in any medium or format, even for commercial purposes, as long as attribution is given to the creator and the new work is licensed under identical terms.</string> | ||
|
|
||
| <string name="unsupported_format_title">Unsupported Format</string> | ||
| <string name="unsupported_format_desc">The selected files could not be opened. Wikimedia Commons strictly requires JPEG, PNG, or SVG formats.</string> |
There was a problem hiding this comment.
Problem: When we add a new supported format, this will need to be re-localized in dozens of languages.
Is there any way to store "JPEG", "PNG", "SVG" as a list, and have the app use this list?
Please note that , is not universal (for instance Japan uses 、 instead) so either find a localization method that allows this, or display each format on a new line after the explanation.
This list should be used by unsupported_files_skipped_desc too.

Description (required)
Fixes #6651
Currently, the app allows users to select or share unsupported file types (like GIFs or WebP) through external intents, only to fail at the final upload stage. This PR implements a validation layer to ensure only the recommended formats are processed.
Changes made:
isSupportedFileTypeutility and animageAllowListcontainin supported MIME types (image/jpeg,image/png,image/svg+xml).receiveSharedItemsthat validates files before they enter the upload.Tests performed (required)
Tested ProdDebug on Redmi Note 13 Pro with API level 36.
Screenshots (for UI changes only)