Access conversion directly from Media object. #2063
Unanswered
pixeldemon9
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is it possible to access a conversion directly from a spatie Media object?
I would like to access a media object directly via a controller (rather than it's associated parent model) and then return a conversion directly. Like here, using the "responsable" interface: https://spatie.be/docs/laravel-medialibrary/v6/advanced-usage/responding-with-media, but for a conversion.
The reason for this is that I would like to run an authorization check to see if the user is permitted to view the file, and then have the file be available you display in img tags as well as direct display in the browser.
using:
return response()->file($media->getPath($conversion));
was working until I switched to S3 storage.
Beta Was this translation helpful? Give feedback.
All reactions