From 8f57df75861fd7b5cf843750d1d7e97a6a76c596 Mon Sep 17 00:00:00 2001 From: Yusuf Date: Tue, 27 Sep 2022 22:23:05 +0300 Subject: [PATCH] Update VueFinder.php --- src/VueFinder.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/VueFinder.php b/src/VueFinder.php index aac363a..cda82fa 100755 --- a/src/VueFinder.php +++ b/src/VueFinder.php @@ -321,6 +321,13 @@ public function move() $items = json_decode($this->request->get('items')); + foreach ($items as $item) { + $target = $to.DIRECTORY_SEPARATOR.basename($item->path); + if ($this->manager->fileExists($target)) { + throw new Exception('One of the files is already exists.'); + } + } + foreach ($items as $item) { $target = $to.DIRECTORY_SEPARATOR.basename($item->path);