Skip to content

Commit

Permalink
Merge branch 'master' into remove-use-of-npm-package-moment-hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
chrieinv authored Aug 25, 2023
2 parents f14b1bb + 31d578d commit 21dbf88
Show file tree
Hide file tree
Showing 12 changed files with 10,509 additions and 18,914 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
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;
use Illuminate\Support\Facades\Log;
use League\Flysystem\FilesystemException;
use League\Flysystem\StorageAttributes;
use Psr\Log\LoggerInterface;
use Symfony\Component\HttpFoundation\StreamedResponse;

class H5PCerpusStorage implements H5PFileStorage, H5PDownloadInterface, CerpusStorageInterface
{
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions sourcecode/apis/contentauthor/config/filesystems.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('CDN_WITH_PREFIX'),
],
// temporary directory for test files
// this has to be its own directory, or your files will go missing!
Expand Down
Loading

0 comments on commit 21dbf88

Please sign in to comment.