Module Description
The File Delete module adds the ability to easily delete files —both private and public— within Drupal administration.

It changes files from the "Permanent" status to the "Temporary" status. These files will be deleted by Drupal during its cron runs.

If a file is registered as being used somewhere, the Module will not allow it to be deleted.

Installation

* We recommend installing the module via Composer. composer require drupal/file_delete Otherwise, Install as you would normally install a contributed Drupal module. See: https://www.drupal.org/node/1897420 for further information.



Configuration

* Configure the user permissions in Administration » People » Permissions:
* Delete files Users with this permission will gain access to delete file entities.


* Add a Delete link to your Files View in Administration » Structure » Views » Files » Edit A new "Link to delete File" field should be available.
* Your Delete File link should now be visible in Administration » Content » Files



Usage Notes
File is set to 'Temporary' but not getting deleted after a cron run In Drupal, Temporary files generally kept for some time — default 6 hours — before being deleted. You can configure this time in Administration » Configuration » Media » File System

Working with Drupal Media If you added an image to the website as a Drupal Media entity, you will have to follow these steps.


* Important: Confirm that this Media is not being used in your site.
* Delete this Media entity in Administration » Content » Media
* Now you can delete the file in Administration » Content » Files

Why is this the case? Drupal's File Usage system still needs some work. It does not correctly track all usages within Drupal. Most of the work related to this is being tracked in #2821423: Dealing with unexpected file deletion due to incorrect file usage Specific to Drupal Media, the work is being tracked in #2835840: Track media usage and present it to the site builder (in the media library, media view, on media deletion confirmation, etc.)



Project Usage
15246
Creation Date
Changed Date
Security Covered
Covered By Security Advisory
Version Available
Production
Module Summary
The File Delete module solves the issue of easily deleting files, both private and public, within Drupal administration by changing files from 'Permanent' to 'Temporary' status and allowing deletion during cron runs.
Data Name
file_delete

OPENAI CHATBOT

OPENAI CHATBOT

09:41:07
Generic Chatbot
Hi, I'm a Drupal module expert powered by OpenAI, answering your questions about the Drupal module ecosystem. How can I be helpful today? Please note that we will log your question.