Prevent Uploads of Files with Identical Names in Different Months

Created on 11 March 2024, 3 months ago
Updated 7 June 2024, 9 days ago

Problem/Motivation

Contributors can upload files with the same name if they are uploaded in different months.
Let's say I create an article with an image named cat.jpg, and then, after one month, another article is created with an image with the same name, cat.jpg. So we will have multiple files with the same name, but they are stored in different folders.
The normal behavior is to append 0_, _1, 2, _3 to the file name if it exists, which works only if the file exists and has been uploaded in less than a month.

Here is an example:

Steps to reproduce

1. Create an article or media with image called d10_test.png
2. After a month create another article or media with another image with the same name (d10_test.png)
3. Go to files page /admin/content/files you will have two files with the same name file but not the same image

Proposed resolution

Fix the upload process to check if the file exists in all the project not the just the current month, if so save the file with FileSystemInterface::EXISTS_RENAME.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

✨ Feature request
Status

Active

Version

11.0 πŸ”₯

Component
File moduleΒ  β†’

Last updated 3 days ago

Created by

πŸ‡«πŸ‡·France berramou

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024