From bd7cd4bdbc1acb63608021ab93c9dafc7a850e09 Mon Sep 17 00:00:00 2001 From: Moritz <46711821+MLDMoritz@users.noreply.github.com> Date: Thu, 27 Jul 2023 02:04:15 +0200 Subject: [PATCH] Fix #3 --- src/VueFinder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/VueFinder.php b/src/VueFinder.php index 188ce07..9071cf4 100755 --- a/src/VueFinder.php +++ b/src/VueFinder.php @@ -382,7 +382,7 @@ public function archive() $items = json_decode($this->request->get('items'), false, 512, JSON_THROW_ON_ERROR); $name .= '.zip'; $path = $this->request->get('path').DIRECTORY_SEPARATOR.$name; - $zipFile = sys_get_temp_dir().$name; + $zipFile = tempnam(sys_get_temp_dir(), $name); if ($this->manager->fileExists($path)) { throw new Exception('The archive is exists. Try another name.'); @@ -431,7 +431,7 @@ public function unarchive() $zipStream = $this->manager->readStream($zipItem); - $zipFile = sys_get_temp_dir().basename($zipItem); + $zipFile = tempnam(sys_get_temp_dir(), $zipItem); file_put_contents($zipFile, $zipStream);