IMCE File Manager
IMCE is an AJAX-based file manager that enables users to browse, upload, and manage files on the server with support for personal directories and user quotas.
imce
Install
composer require 'drupal/imce:^3.1'
Overview
IMCE (Image for TinyMCE) is a comprehensive file manager module for Drupal that provides an AJAX-based interface for managing files on the server. Despite its name originating from its initial purpose as an image browser for TinyMCE Editor, IMCE has evolved into a full-featured file management solution.
The module allows administrators to create configuration profiles that define folder access, file upload permissions, allowed file extensions, size limits, and disk quotas. These profiles can be assigned to user roles per file system (public, private, etc.), enabling fine-grained access control. Personal folders are supported through user tokens, allowing each user to have their own dedicated directory space.
IMCE provides a modern, responsive user interface with a folder tree navigation, file listing with sorting options, file preview panel, and toolbar buttons for various operations. The file manager supports uploading files, creating new folders, deleting files and folders, and resizing images. Integration is provided for CKEditor 5, BUEditor, and Drupal's native file/image field widgets, allowing users to browse and select files directly from these contexts.
Features
- AJAX-based file browser with folder tree navigation and file listing
- Configuration profiles for role-based access control per file system
- Personal folders using user tokens (e.g., [user:uid], [user:name])
- File upload with validation for extensions, size limits, and image dimensions
- File deletion with file usage checking to prevent deletion of files in use
- New folder creation within accessible directories
- Image resizing with copy option and dimension validation
- Disk quota management per user
- Thumbnail preview support using Drupal image styles
- CKEditor 5 integration with image and link toolbar buttons
- BUEditor integration as a configurable file browser
- File/Image field widget integration with 'Open File Browser' button
- Support for multiple file systems (public, private, S3, etc.)
- Absolute and relative URL generation for files
- Admin theme option for file manager paths
- Session-based active folder memory
Use Cases
Personal user directories
Create personal file spaces for each user by configuring a folder path with user tokens like 'users/user[user:uid]'. Each user will only see and manage files in their own directory, with automatic folder creation on first access.
Role-based media management
Set up different access levels by creating profiles for content editors (full access to shared media folder), authors (upload-only access to their personal folder), and members (view-only access). Assign profiles to roles per file system.
CKEditor 5 image insertion
Allow content editors to insert images from the file server into content. Configure a text format with CKEditor 5, disable built-in image uploads, and use the IMCE image toolbar button. Users can browse, upload, and select images.
Private file downloads
Manage files in the private file system that require authentication. IMCE implements hook_file_download() to validate access, ensuring users can only download files they have IMCE access to.
Image gallery management
Configure a profile with image-only extensions (jpg png gif webp), image dimension limits, and resize permission. Users can upload images that are automatically scaled to maximum dimensions and manually resize existing images.
Multi-site shared storage
Use IMCE with S3 or other remote file systems by enabling 'URL altering' and 'lazy dimensions' options in the profile to handle remote file URLs correctly and improve performance.
Tips
- Create a custom menu item at /imce to provide direct access to the file manager for end users
- Disable CKEditor 5 image uploads to see the IMCE link in the image dialog, or use the dedicated IMCE Image toolbar button
- Use the Duplicate operation to quickly create similar profiles with different settings
- Enable thumbnail previews with caution as they can slow down the file browser with many images
- Use role weight ordering to control which profile takes precedence for users with multiple roles (last assigned wins)
- Enable 'Use admin theme for IMCE paths' if you experience UI issues with your front-end theme
- Personal folders are created automatically when users first access them
- The browser remembers the last active folder in the user session for convenience
Technical Details
Admin Pages 9
/admin/config/media/imce
Main configuration page for IMCE that displays both the settings form and the list of configuration profiles. Administrators can assign profiles to user roles per file system and manage global settings.
/admin/config/media/imce/add-profile
Form for creating a new IMCE configuration profile that defines folder access, permissions, and file restrictions.
/admin/config/media/imce/{imce_profile}
Edit an existing IMCE configuration profile.
/admin/config/media/imce/{imce_profile}/delete
Confirmation form for deleting an IMCE configuration profile.
/admin/config/media/imce/{imce_profile}/duplicate
Creates a copy of an existing configuration profile with a new name.
/admin/imce/help
Help page with documentation and tutorial videos for configuring and using IMCE.
/admin/imce/browser
Administrative file browser interface embedded in an iframe, allowing administrators to manage files directly.
/imce/{scheme}
The main IMCE file browser interface. The {scheme} parameter specifies the file system (public, private, etc.). Defaults to the site's default file system when not specified.
/user/{user}/imce
User profile tab that displays the IMCE file browser for users whose assigned profile has the 'Display file browser tab in user profile pages' option enabled.
Permissions 1
Hooks 2
hook_imce_supported_widgets_alter
Allows modules to alter the list of supported file field widgets that can integrate with IMCE.
hook_imce_plugin_info_alter
Allows modules to alter IMCE plugin definitions.
Security Notes 7
- The 'administer imce' permission is restricted and grants full access to all file management features
- Anonymous user access warning is displayed when configuring profiles for anonymous role
- File usage checking prevents deletion of files referenced by content unless explicitly disabled
- File name validation prevents directory traversal and special characters
- CSRF token validation protects all AJAX operations
- Personal folder paths with user tokens ensure users cannot access other users' directories
- Files uploaded through IMCE are set as permanent and registered in the file_managed table