Skip to content

Commit aa889f6

Browse files
mortzastreamtw
authored andcommitted
add new option over_write_on_duplicate
1 parent 221b785 commit aa889f6

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/LfmPath.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ private function uploadValidator($file)
248248

249249
$new_file_name = $this->getNewName($file);
250250

251-
if ($this->setName($new_file_name)->exists()) {
251+
if ($this->setName($new_file_name)->exists() && !config('lfm.over_write_on_duplicate')) {
252252
return $this->error('file-exist');
253253
}
254254

src/config/lfm.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@
2525
// Use relative paths (without domain)
2626
'relative_paths' => false,
2727

28+
// behavior on files with identical name
29+
// setting it to true cause old file replace with new one
30+
// setting it to false show `error-file-exist` error and stop upload
31+
'over_write_on_duplicate' => false,
32+
2833
/*
2934
|--------------------------------------------------------------------------
3035
| Multi-User Mode

0 commit comments

Comments
 (0)