- Issue created by @r0nn1ef
- Merge request !21fixed fatal error bug when using remote file system modules such as s3fs. β (Open) created by r0nn1ef
- Status changed to Needs review
10 months ago 2:52pm 17 June 2024 - ππΊHungary Sweetchuck Budapest
Why does the
DownloadController::download()
deals with the file serving?Would not be easier just to redirect to the file URL, like this?
For all cases, not just for remote files.class DownloadController { public function download(MediaInterface $media): Response { // Get the $file as usually. return new \Symfony\Component\HttpFoundation\RedirectResponse($file->createFileUrl()); } }
- πΊπΈUnited States r0nn1ef
I have not tried this, but this fork could possibly be a solution for β¨ Add support for Stage File Proxy Needs review .
- πΊπΈUnited States r0nn1ef
@sweetchuck, that is how the module was designed. I didn't want to re architect the whole thing. That is a whole different discussion that should probably be had because it makes sense.
- πΊπΈUnited States r0nn1ef
Here is the patch file generated from the fork.
- πΊπΈUnited States moshe weitzman Boston, MA
When files are remote (S3fs, stage file proxy), it makes even less sense to for Drupal to fetch them and send a StreamedResponse. Could we use the code from #5 just for remote files? Then a different issue could discuss using a redirect for local files.