This project is not covered by Drupal’s security advisory policy.
Specify what should happen when uploaded files and images have the same name as existing files. Configured per field, the options are are grouped by entity type.
The module aims to work with all file fields without having to replace existing widgets or file fields. It does this by altering the underlying file handling rather than the UI.
To use, install and go to Admin -> Config -> Media -> File Upload Options to configure.
It also supports file uploads via REST.
Fields defined in code
To configure file fields defined in code, specify the field name under "Custom Fields".
Alternatively, non-entity fields will be automatically added to "Custom Fields" when viewing the form with the field on it. The replace behaviour can then be configured within File Upload Options.
REST
- Ability to specify how to handle existing files with the same file name
- Re-use an existing file entity with the same URI rather than create a new one
Why?
Currently there is no unified way of handling file uploads in Drupal core. Additionally, many contrib modules go about it their own way. File replace options are generally not available in the UI and are difficult to achieve even in code.
There are a number of related issues which deal with the issue of file management. Once these are resolved modules such as File Upload Options would be much simpler or preferably obsolete.
- #2940383: [META] Unify file upload logic of REST and JSON:API
- #2648816: Uploaded files are impossible to replace
- #2241865: Do not create a new file entity in order to overwrite an existing entity
- #3221796: [META] Modernise file upload logic
Similar modules
See the project pages for how these modules work.
Project information
Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed.- Project categories: Decoupled, Media, Site structure
145 sites report using this module
- Created by imclean on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
Releases
Supports for Drupal 11
Development version: 8.x-1.x-dev updated 15 Jan 2025 at 13:49 UTC
