From f32ae3a4d4f1168924b06924070248a8397233da Mon Sep 17 00:00:00 2001 From: Svein-Tore Griff With Date: Sun, 17 Nov 2013 18:26:39 +0100 Subject: [PATCH] We save the file instead of returning it for performance reasons --- h5p.classes.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/h5p.classes.php b/h5p.classes.php index 51fca3b..675c86c 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -1057,7 +1057,7 @@ Class H5PExport { * The data to be exported. * @return H5P package. */ - public function exportToZip($exportData) { + public function getExportPath($exportData) { $h5pDir = $this->h5pF->getH5pPath() . DIRECTORY_SEPARATOR; $tempPath = $h5pDir . 'temp' . DIRECTORY_SEPARATOR . $exportData['contentId']; $zipPath = $h5pDir . 'exports' . DIRECTORY_SEPARATOR . $exportData['contentId'] . '.h5p'; @@ -1140,11 +1140,7 @@ Class H5PExport { $this->h5pC->delTree($tempPath); } - // Set headers for automagic download!! - header('Content-Description: File Transfer'); - header('Content-Type: application/zip'); - header('Content-Disposition: attachment; filename="' . $exportData['title'] . '.h5p"'); - readfile ($zipPath); + return str_replace(DIRECTORY_SEPARATOR, '/', $zipPath); } private function addEditorLibraries($libraries) {