Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This module allows you to "lock" files so they cannot be deleted.
File Lock can be used to control two different problems:
- Preventing deliberate deletion of files
- Preventing accidental deletion of files caused by the behaviour of Drupal's core file field
File Lock is particularly useful when used with a media library setup, for example using the Media module.
Features
- "Update options" in file overview (for existing files)
- Lock selected files
- Unlock selected files
- Automatic file lock for new files
- All files
- by filename pattern
- by regular expression
- Selectable by operation:
- all -> all file_save actions
- file_insert -> file create actions (new files)
- file_update -> file update actions (existing files)
- Integration with Actions, allowing un/locking of files using Views Bulk Update/Admin Views
File Lock acts in the background, there is no UI which shows the files that are locked and which aren't. A workaround is use a view in media browser showing the file_usage.
Supporting organizations:
Project information
- Seeking co-maintainer(s)
Maintainers are looking for help reviewing issues. - Maintenance fixes only
Considered feature-complete by its maintainers. - Module categories: Media
- 2,108 sites report using this module
- Created by Shuairan on , updated
- Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
Releases
7.x-2.0
released 2 September 2014
Works with Drupal: 7.x
✓ Recommended by the project’s maintainer.
Development version: 7.x-2.x-dev updated 2 Sep 2014 at 02:43 UTC