Check for duplication of uploaded files

Created on 21 March 2024, 3 months ago
Updated 26 March 2024, 3 months ago

Problem/Motivation

Having duplicate files in the file system is a waste of space and bandwidth. This is especially true when we are duplicating the process of creating responsive images for different view ports.

It would be great if we could know if a file has already been uploaded and allow authors to make a conscious decision to proceed with uploading it again, or simply link to the new file.

Ideally, when uploading a new file a MD5 hash would be created for the image you want to upload that would be compared with the listing of images that have already been uploaded by Drupal. It should be possible to avoid sending any more than an MD5 and an answer (duplicate or not) before or even during a file upload.

Steps to reproduce

- In a new instance, create two articles and in each, upload a new file.
- You will get no error, nor alert that anything has changed.

Proposed resolution

- Notify the user that a duplicate has been uploaded, and ask them if they would prefer to use it.

Remaining tasks

-

User interface changes

- We'd need an alert message and a confirmation of choice to re-upload or re-use the previously uploaded image.

API changes

- Not sure

Data model changes

- I think we'd need a table with a listing of MD5 hashes and file names.

Release notes snippet

-

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component
File systemΒ  β†’

Last updated about 1 hour ago

Created by

πŸ‡¨πŸ‡¦Canada mgifford Ottawa, Ontario

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

Comments & Activities

Production build 0.69.0 2024