Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). Varbase Media Header 9.2.1 Minor update available for module varbase_media_header (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

File Upload Options

146 sites No security coverage
View on drupal.org

This module controls how Drupal handles uploaded files that have the same name as existing files. It allows you to choose whether to replace the existing file or create a new one, and supports this functionality for all file fields, including those used with REST.

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

  1. Ability to specify how to handle existing files with the same file name
  2. 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.

Similar modules

See the project pages for how these modules work.

Activity

Total releases
1
First release
Jan 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Dormant

Releases

Version Type Release date
8.x-1.1 Stable Jan 16, 2025