Skip to content

Commit

Permalink
Merge pull request #4 from MLDMoritz/patch-1
Browse files Browse the repository at this point in the history
Update of temp file creation
  • Loading branch information
n1crack authored Jul 27, 2023
2 parents 37a3291 + bd7cd4b commit 018fabc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/VueFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 018fabc

Please sign in to comment.