diff --git a/tinyfilemanager.php b/tinyfilemanager.php index efc3ce6..8d1cc48 100644 --- a/tinyfilemanager.php +++ b/tinyfilemanager.php @@ -927,6 +927,7 @@ if (!empty($_FILES) && !FM_READONLY) { $chunkIndex = $_POST['dzchunkindex']; $chunkTotal = $_POST['dztotalchunkcount']; $fullPathInput = fm_clean_path($_REQUEST['fullpath']); + $overwrite_files = ($_REQUEST['overwrite_files'] ?? 'N'); $f = $_FILES; $path = FM_ROOT_PATH; @@ -1016,7 +1017,12 @@ if (!empty($_FILES) && !FM_READONLY) { if ($chunkIndex == $chunkTotal - 1) { if (file_exists ($fullPath)) { $ext_1 = $ext ? '.'.$ext : ''; - $fullPathTarget = $path . '/' . basename($fullPathInput, $ext_1) .'_'. date('ymdHis'). $ext_1; + + if ($overwrite_files == 'Y') { + $fullPathTarget = $path . '/' . basename($fullPathInput, $ext_1) . $ext_1; + } else { + $fullPathTarget = $path . '/' . basename($fullPathInput, $ext_1) .'_'. date('ymdHis'). $ext_1; + } } else { $fullPathTarget = $fullPath; } @@ -1354,11 +1360,13 @@ if (isset($_GET['upload']) && !FM_READONLY) { :

+

+