diff --git a/sourcecode/apis/contentauthor/app/Libraries/H5P/Interfaces/H5PDownloadInterface.php b/sourcecode/apis/contentauthor/app/Libraries/H5P/Interfaces/H5PDownloadInterface.php index 1f6ea9422b..2237191d60 100644 --- a/sourcecode/apis/contentauthor/app/Libraries/H5P/Interfaces/H5PDownloadInterface.php +++ b/sourcecode/apis/contentauthor/app/Libraries/H5P/Interfaces/H5PDownloadInterface.php @@ -2,9 +2,9 @@ namespace App\Libraries\H5P\Interfaces; -use Symfony\Component\HttpFoundation\StreamedResponse; +use Symfony\Component\HttpFoundation\Response; interface H5PDownloadInterface { - public function downloadContent(string $filename, string $title): StreamedResponse; + public function downloadContent(string $filename, string $title): Response; } diff --git a/sourcecode/apis/contentauthor/app/Libraries/H5P/Storage/H5PCerpusStorage.php b/sourcecode/apis/contentauthor/app/Libraries/H5P/Storage/H5PCerpusStorage.php index 604f575c7f..eb3429071f 100644 --- a/sourcecode/apis/contentauthor/app/Libraries/H5P/Storage/H5PCerpusStorage.php +++ b/sourcecode/apis/contentauthor/app/Libraries/H5P/Storage/H5PCerpusStorage.php @@ -15,6 +15,7 @@ use Exception; use H5PFileStorage; use Illuminate\Contracts\Filesystem\Filesystem; +use Illuminate\Http\RedirectResponse; use Illuminate\Http\UploadedFile; use Illuminate\Support\Facades\Storage; use Illuminate\Support\Str; @@ -22,7 +23,6 @@ use League\Flysystem\FilesystemException; use League\Flysystem\StorageAttributes; use Psr\Log\LoggerInterface; -use Symfony\Component\HttpFoundation\StreamedResponse; class H5PCerpusStorage implements H5PFileStorage, H5PDownloadInterface, CerpusStorageInterface { @@ -537,11 +537,11 @@ public function saveFileFromZip($path, $file, $stream): bool return $upload; } - public function downloadContent(string $filename, string $title): StreamedResponse + public function downloadContent(string $filename, string $title): RedirectResponse { $path = sprintf(ContentStorageSettings::EXPORT_PATH, $filename); - return $this->filesystem->response($path); + return new RedirectResponse($this->filesystem->url($path)); } public function getDisplayPath(bool $fullUrl = true)