Skip to content

Commit

Permalink
Fix export
Browse files Browse the repository at this point in the history
  • Loading branch information
daVitekPL committed Nov 13, 2024
1 parent 768ea82 commit ba99cae
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Services/H5PExportService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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';
Expand Down

0 comments on commit ba99cae

Please sign in to comment.