Background
Currently, the system allows uploading multiple identical documents to the same collection, which can lead to data redundancy and storage waste. There is no mechanism in place to detect and prevent duplicate files.
Proposal
Implement duplicate detection for document uploads within the same collection using one of the following methods:
- Filename comparison: Check if a file with the same name already exists in the collection
- MD5 hash comparison: Calculate and compare MD5 checksums to detect identical file content
When a duplicate is detected, the system should:
- Display a clear error message to the user
- Prevent the upload from completing
- Optionally provide options to replace the existing file or rename the new one
This feature will help maintain data integrity and optimize storage usage.