Existing File Upload Conflict Option #1312
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 toNEW
if the delete operation fails.As a security precaution, if the existing file is in
$exclude_items
, the upload will fall back to the currentNEW
behaviour.Closes #938 (technically already closed), Closes #1211