Skip to content

Existing File Upload Conflict Option #1312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

MarkIvanowich
Copy link

When uploading a file that already exists, the code will currently append a timestamp to the end of the file to avoid overwriting. Previous advice was to remove an if statement to overwrite the file #1133.

This PR adds configuration option $upload_name_conflict_handling with the following logic:

  • NEW : The newly uploaded file is renamed with a timestamp (current behaviour)
  • OLD : The old file is renamed with a timestamp, new file keeps desired name. (my recommended default)
  • REPLACE : The old file is deleted before the new file keeps the desired name. Fallback to NEW if the delete operation fails.

As a security precaution, if the existing file is in $exclude_items, the upload will fall back to the current NEW behaviour.

Closes #938 (technically already closed), Closes #1211

Added `$upload_name_conflict_handling` option for handling upload of files that already exist.
Additional checks to ensure an uploaded file is not on the `exclude_items` list.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Overwrite File not working BUG: upload a file with the same name of one already present in the filemanager
1 participant