Uuidpath (for file uploads)
This module generates a unique identifier (UUID) for uploaded files, creating a structured path for each file that helps prevent large directories and filename conflicts. It also provides a degree of security by obscurity for public files.
The uuidpath module generates file uuid on upload and adds it as path to file destination.
When uploading a file there isn't any id at first.
Unlike serial file id (fid) a uuid can be created even if the files isn't used after uploading. Forcing an uiid creation on upload allows to create valid link in content even before the content content entity is created or the file entity is created. On a second step this module retrieves the uuid from the path when the file entity is created add it to the file entity.
The uuid path is created with 11 subfolders (see exaple below) to make sure that every foleder in classic linux file system never gets to many entries. Because every file gets its own folder there will never be duplicate filename situation as long as the core uuid service won't bring a double entry.
Features
When a public file field has name schema for current month (default) and a file named "example.png" is uploaded the result looks like: /sites/default/files/2026-08/0c/3d/d6/0a/1c/c9/43/8d/8e/bc/f25490bd0036/example.png
Even if the same file(name) is used a million times, only the uuid will change and the filename will always be the same.
So the core strategy to avoid too many files in one folder with year and month tokens can so be replaced by a fixed path like "uuid".
There is also a benefit that the file path can not be guessed so you get a little bit extra security on public files. This is only security by obscurity but the same security as many social media platforms and services are providing. If really security is needed the drupal private file system is strongly recommended.
Post-Installation
Install as you would normally install a contributed Drupal module.
See: https://www.drupal.org/node/1897420 for further information.
Additional Requirements
None