Any long-lived Drupal site, whether it stores files in a local folder or a remote bucket like Amazon S3, holds hundreds of files, and there is no easy way to see which ones Drupal still tracks and which it has lost sight of. The files come from four places: live content, leftovers from nodes deleted years ago, migration and backup residue, and direct uploads, such as a PDF dropped onto the server because it was faster.
This is a common problem in the sector, and it does not depend on the technology in use. Every content system faces it sooner or later. The root cause is two stores that must agree: the bytes in storage versus the database that is supposed to keep track of them. The moment both stores exist, they drift. It happens in three ways: records get deleted but the files stay, files get uploaded but never registered, and jobs fail halfway.
These accumulated unreferenced files are untracked files, a kind of dark data: information an organisation keeps but no longer uses.
The first cost is storage and governance, not just disk space. The second, sharper cost is exposure and security. An untracked file does not always disappear. In many setups it stays physically present, and anyone with the URL can download it. A document deleted in content can still sit in storage. A sensitive file uploaded directly, by FTP, migration, or other means, never registers with Drupal at all. It sits exposed at its URL, and no screen even lists it.
Severity depends on the content type: trivial for ordinary assets, serious for contracts, personal data, or internal reports. The organisation stays responsible for files it cannot even see.
A file entity is Drupal's record of a file. A media entity wraps that file with a type, metadata, and a reusable identity, and it is Drupal's recommended way to handle files. Drupal also tracks where each file is used. The principle everything else rests on: a file only exists for Drupal through these records. No record means a file is not tracked by the application, so it is not managed in any way.
This is the case of unmanaged files: files on disk with no file entity at all. Drupal is blind to them. Because nothing references them, nothing governs them, and no screen lists them.
There is another case: files known by Drupal but not used anywhere. Orphaned managed files are this case. The file entity exists, but the usage count has dropped to zero, usually because the node or media item using the file was deleted. Drupal knows about the file; it just never cleans it up by default.
Either way, storage grows silently, and there is no built-in screen that reconciles the files present in storage against the managed entities.
There are some other modules that deal with this problem, but it is good to know to what extent:
Both share something: they are developer-facing tools whose answer is to delete or to bare-register. None brings the file under management as a reusable asset, and none targets the editor or site builder who owns the content.
File Inspector does three things about the discussed problem: it inventories everything in storage, it reconciles each file against what Drupal manages, and it lets you either delete true orphans or promote useful files into managed Media. It does all of this from a readable UI, not the command line, and that UI is its main differentiator. It rests on a few principles:
The steps for using this module are as follows:
Generate the report: A batch size tunes how many files run per pass. The scan iterates with generators and the Batch API, so it inventories files without exhausting memory. The results are stored in a dedicated table for fast querying, instead of being recomputed on every view.
Read the report: overview and file list: The overview page is a report you can actually read, with the inventory reconciled against the managed entities. It has two tabs: Overview counts every file by status, such as managed, unmanaged, or imported, with a grand total, and the file list shows every file found.
Filter and act with Views: The report is built on Views: filter by status, MIME type, or date, run bulk operations, and extend it as a site builder without code. This directly solves the "built for coders" gap.
Reconcile each file: You decide whether to delete a file or import it into a media item. For an unmanaged file worth keeping, you promote it to a managed Media entity in a single action and choose the media type. This creates both the file entity and the Media item, which appears in the Media library, and records the link between the report row and the Media it produced. The file becomes a reusable asset, not just a registered one. Reconciliation becomes a first-class workflow, aligned with Drupal's recommended file handling.
The drift between storage and database is universal, and it carries real costs in storage, governance, and trust. Drupal only makes it concrete: files end up with no entity, invisible to the system meant to track them. Existing tools proved the need, but they are developer-facing, and their best answer is to delete or to bare-register.
File Inspector takes a different stance, in four points: inventory first; reconcile all the way to a usable Media item; built for the people who manage the content; scale to real sites with a lot of content. There is now a user-friendly way to manage untracked files in Drupal.




