Media Dupe Detect is a Drupal module that enhances the core Media and Media Library experience by automatically identifying duplicate file uploads.
When a user uploads a file through a Media Library widget, the module compares the file hash against existing files. If a match is found, the user is prompted to reuse the existing media item instead of creating a new one.
Features
Media Dupe Detect integrates with the Media Library widget and provides:
- Detection of duplicate media items based on file hash
- A prompt to reuse existing media items when a duplicate is found
- A role-based permission that allows trusted users to bypass duplicate detection
- Field-level configuration so duplicate checks can be enabled per media field
Typical use cases include:
- Keeping the Media Library clean and organized
- Preventing unnecessary duplication of images and documents
- Supporting large teams and editorial workflows where many users upload assets
Configuration
After installing and enabling the module and its dependencies:
- Go to the Form display configuration for the content type or entity type that uses a media field (for example:
Structure → Content types → Your type → Manage form display). - On the Media Library widget for the media field, click the gear icon to open the widget settings.
- Enable the Detect duplicates option to turn on duplicate detection for that field.
- Navigate to People → Permissions and use the Bypass media duplicate upload prevention permission to allow specific roles to upload duplicates when needed.
The module does not add any new configuration pages or content types. All behavior is controlled through existing form display settings and permissions.
Requirements
Media Dupe Detect relies on Drupal core media functionality and file hashing:
- Drupal core Media (version 10 or 11)
- Drupal core Media Library
- File Hash module, used to compute and compare file hashes
For more details, downloads, and issue tracking, see the Media Dupe Detect project page.