dumd
Direct Upload Media Document (DUMD)
A modern, user-friendly document upload widget for Drupal Media with drag-and-drop support, real-time previews, and automatic PDF thumbnail generation.
Why Direct Upload Media Document?
The default Drupal Media library workflow can be cumbersome for users who just want to quickly upload and attach documents to their content. DUMD streamlines this process by providing a direct upload interface right within your content form - no separate media library steps required.
Key Features
Intuitive Upload Experience
- Drag-and-drop document uploads directly on entity forms
- Multi-file upload support with auto-expanding slots
- Real-time document previews with thumbnails
- Clean, modern interface that works seamlessly on desktop and mobile
Smart PDF Handling
- Automatic thumbnail generation from first page of PDFs
- Configurable DPI and quality settings
- Support for custom image styles on thumbnails
- Fallback to document icons for non-PDF files
Flexible Display Options
- Multiple formatter options: embedded viewer, thumbnail, icon, or download link
- Configurable file information display (filename, size, extension)
- Responsive design for all screen sizes
- Support for custom image styles
Developer-Friendly
- Standard Drupal plugin architecture (FieldWidget and FieldFormatter)
- Extensive configuration options per field and globally
- Secure temporary file handling with automatic cleanup
- Clean, well-documented code following Drupal coding standards
Security & Performance
- Uses Drupal's private file system for secure uploads
- Automatic cleanup of temporary files via cron (24-hour threshold)
- File validation (size, extension, MIME type)
- Protected preview files that prevent direct access
Use Cases
- Content editors who need quick document uploads without navigating the media library
- Forms with multiple document fields where the standard media widget becomes repetitive
- Public-facing forms where a simplified upload experience improves conversion
- Document-heavy sites (legal, academic, corporate) requiring efficient document management
Configuration Options
Global Settings (admin/config/media/dumd)
- File size limits
- Allowed file extensions
- PDF thumbnail generation settings (DPI, quality, dimensions)
- Custom upload button images per media bundle
Field Widget Settings
- Thumbnail image style for previews
- Per-field file size overrides
- Number of empty upload slots
- Auto-expand slots for multi-file uploads
- Hide/show empty slots
- Display file information
Field Formatter Settings
- Display format (embedded, thumbnail, icon, link only)
- Image style for thumbnails
- Embedded viewer height
- Show/hide download links
- Show/hide file information
Requirements
- Drupal: 11.2 or higher
- PHP modules: GD or Imagick (for image processing)
- Server software: ImageMagick + Ghostscript (for PDF thumbnails)
- Drupal modules: Media, File, Image
- Private files directory configured
Installation
1. Install via Composer: `composer require drupal/dumd`
2. Enable the module: `drush en dumd`
3. Configure private files directory if not already done
4. Visit Configuration → Media → DUMD Settings to configure
Usage
1. Add or edit an entity reference field (Media type)
2. Select "Direct Upload Media Document" as the widget
3. Configure widget settings as desired
4. Select "DUMD Document Display" as the formatter (optional)
5. Save and start uploading documents!
Similar Projects
Unlike the Media Library widget which opens a separate overlay, DUMD provides inline uploads directly in the form. Unlike DropzoneJS which focuses on generic file uploads, DUMD is specifically optimized for document-focused Media entities with features like PDF thumbnails and document icons.
Maintainers
Currently seeking maintainers and co-maintainers. Contributions welcome!
Support
- Issue queue: For bug reports and feature requests
- Documentation: Comprehensive README.md included
- Community support: Available through issue queue
License
GPL-2.0-or-later
Part of Direct Upload Media Suite
This module is part of a collection of tools designed to quicken media upload flow:
DUMI
A fast, streamlined way to upload images directly from form.
DUMA
Upload audio files directly from content forms with a preview HTML5 audio player.
DUMVE:
Remote video and embed video on node edit forms and content display.