Skip to content

Commit

Permalink
Merge branch 'master' into ca-npm-update-202304
Browse files Browse the repository at this point in the history
  • Loading branch information
chrieinv committed Aug 24, 2023
2 parents 3283dae + c75c8d0 commit b1a5eac
Show file tree
Hide file tree
Showing 10 changed files with 10,475 additions and 16,965 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 b1a5eac

Please sign in to comment.