tinyfilemanager icon indicating copy to clipboard operation
tinyfilemanager copied to clipboard

Added 'Overwrite Files' Checkbox to Give Users the Option of Overwriting Existing Files During Upload

Open uwecmyersjj opened this issue 1 year ago • 3 comments

This would be an optional checkbox users could choose to use in the case they want to overwrite uploaded files if there is already one that matches the same filename.

filemanager-overwrite-checkbox

uwecmyersjj avatar Jan 31 '24 20:01 uwecmyersjj

Haven't tested this, but in theory it's a worthwhile addition.

Just a nitpick: keep the code formatting in line with the current style, for example:

if ($overwrite_files == 'Y') {
    $fullPathTarget = $path . '/' . basename($fullPathInput, $ext_1) . $ext_1;
} else {
    $fullPathTarget = $path . '/' . basename($fullPathInput, $ext_1) .'_'. date('ymdHis'). $ext_1;
}

ner00 avatar Jan 31 '24 21:01 ner00

Tested and works like a charm with version 2.5.3! Easy to implement. Thank you!

nerun avatar May 26 '24 17:05 nerun

Suggestion, to be able to translate:

Replace

  •  Overwrite existing files? by
  • &nbsp;<?php echo lng('Overwrite existing files?') ?>

Add around line 4310

  • $tr['en']['Overwrite existing files?'] = 'Overwrite existing files?';

nerun avatar Jul 02 '24 20:07 nerun