From ba99cae148ba9c40fcb807bc4d23983564f1231c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Witold=20Wis=CC=81niewski?= Date: Wed, 13 Nov 2024 12:40:48 +0100 Subject: [PATCH] Fix export --- src/Services/H5PExportService.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Services/H5PExportService.php b/src/Services/H5PExportService.php index 0505bc6..7953dff 100644 --- a/src/Services/H5PExportService.php +++ b/src/Services/H5PExportService.php @@ -116,7 +116,8 @@ public function createExportFile($content) { // Create new zip instance. $zip = new ZipArchive(); - $zip->open($zipPath, ZipArchive::CREATE | ZipArchive::OVERWRITE); + $zipName = Str::afterLast($zipPath, '/') . '.zip'; + $zip->open($zipName, ZipArchive::CREATE | ZipArchive::OVERWRITE); // Add all the files from the tmp dir. foreach ($files as $file) { @@ -129,7 +130,7 @@ public function createExportFile($content) { // Close zip and remove tmp dir $zip->close(); - Storage::putFileAs('h5p/temp', new File($zipPath), Str::afterLast($tmpFile, '/')); + Storage::putFileAs('h5p/temp', new File($zipName), Str::afterLast($tmpFile, '/')); H5PCore::deleteFileTree($tmpPath); $filename = $content['slug'] . '-' . $content['id'] . '.h5p';