Summary
The upload UI currently blocks duplicate filenames client‑side, preventing server‑side overwrite workflows (e.g., versioning systems, audit trails, WebDAV). Add a configuration option to allow duplicates with user confirmation, while defaulting to the current blocking behavior when the option is not set.
Current behavior (blocking)
In frontend/src/FileManager/Actions/UploadFile/UploadFile.action.jsx , the checkFileError function rejects duplicate filenames::
const fileExists = currentPathFiles.some(
(item) => item.name.toLowerCase() === file.name.toLowerCase() && !item.isDirectory
);
if (fileExists) return t("fileAlreadyExist");
Result: User cannot upload a file with the same name as an existing file, even if the backend supports overwrite.
Requested behavior
Add a config flag to fileUploadConfig:
<FileManager
...
fileUploadConfig={{ allowOverwrite: true }}
/>
Logic:
- Default behavior remains unchanged (duplicates are blocked)
- If allowOverwrite is true:
-- show a confirmation prompt when duplicate name is detected
-- if user confirms → proceed with upload
-- if user cancels → abort upload
Pseudo‑code:
if (fileExists) {
if (!_allowOverwrite_) return t("fileAlreadyExist");
const confirmed = window.confirm(t("confirmOverwrite"));
if (!confirmed) return t("uploadCanceled");
}
Rationale
Backends with versioned storage, audit trails, or WebDAV require overwrites to be handled server‑side:
- Example: REST API with overwrite=true header creates UPDATE audit entries (not DELETE + CREATE)
- Example: WebDAV PUT operations with precondition headers manage versions
- Current limitation: Client blocks the upload before server can decide
This enhancement allows backends to implement proper versioning while maintaining safe defaults for traditional file managers.
Acceptance criteria
i18n additions
{
"confirmOverwrite": "A file with this name already exists. Do you want to replace it?",
"uploadCanceled": "Upload canceled."
}
Summary
The upload UI currently blocks duplicate filenames client‑side, preventing server‑side overwrite workflows (e.g., versioning systems, audit trails, WebDAV). Add a configuration option to allow duplicates with user confirmation, while defaulting to the current blocking behavior when the option is not set.
Current behavior (blocking)
In frontend/src/FileManager/Actions/UploadFile/UploadFile.action.jsx , the checkFileError function rejects duplicate filenames::
Result: User cannot upload a file with the same name as an existing file, even if the backend supports overwrite.
Requested behavior
Add a config flag to fileUploadConfig:
Logic:
-- show a confirmation prompt when duplicate name is detected
-- if user confirms → proceed with upload
-- if user cancels → abort upload
Pseudo‑code:
Rationale
Backends with versioned storage, audit trails, or WebDAV require overwrites to be handled server‑side:
This enhancement allows backends to implement proper versioning while maintaining safe defaults for traditional file managers.
Acceptance criteria
i18n additions