Skip to content

Updating files through the file widget #753

@smn-cds

Description

@smn-cds

One of our content editors reported unexpected behavior when replacing a file through the file widget.

The editor is trying to update an existing file, for example document.pdf, with a new version that has the same filename.

Steps to reproduce

  1. In the file widget, click the Replace button.
  2. The Select File dialog opens.
  3. Upload a new file with the same name, for example document.pdf.
  4. The dialog shows the updated document.pdf as Unsaved and does not indicate that an existing file with the same name already exists.
  5. Click the Insert button.
  6. The file widget still shows a path ending with document.pdf.
  7. Save the entry.
  8. The uploaded file is stored as document-1.pdf while the original document.pdf remains unchanged.
  9. Reopen the entry editor. The file widget now points to document-1.pdf.

Expected behavior

When using the Replace dialog to upload a file with the same filename, the existing file should be replaced.

To make this behavior clearer, the UI could prompt the user when a file with the same name already exists, for example:

“A file with this name already exists. What would you like to do?”

• Replace existing file
• Keep both files

The UI should also clearly indicate when a new file will be created instead of updating the existing one.

Actual behavior

The interface suggests that the existing file will be updated, but after saving, a new file is created with a -1 suffix instead.

This behavior is unexpected and confusing for content editors because the original file is not replaced or removed.

Metadata

Metadata

Assignees

Labels

No labels
No labels
No fields configured for Feature.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions