Media Dupe Detect

8 months ago
Media Dupe Detect is a Drupal module that integrates with the Media Library to detect duplicate file uploads by hash and prompt users to reuse existing media instead of creating new items.
Media Dupe Detect module page on Drupal.org
Drupal Module

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:

  1. 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).
  2. On the Media Library widget for the media field, click the gear icon to open the widget settings.
  3. Enable the Detect duplicates option to turn on duplicate detection for that field.
  4. 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:

For more details, downloads, and issue tracking, see the Media Dupe Detect project page.

Related Content