Created
October 26, 2023 15:02
-
-
Save rela589n/e677f31672f353919ca9a89be9961e16 to your computer and use it in GitHub Desktop.
Symfony streaming responses from the file system
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return new StreamedResponse( | |
static fn (): int => fpassthru($photo->stream), | |
headers: [ | |
'Content-Type' => $photo->mimeType, | |
'Content-Length' => $photo->fileSize, | |
'Content-Disposition' => HeaderUtils::makeDisposition( | |
HeaderUtils::DISPOSITION_INLINE, | |
$photo->baseName, | |
), | |
], | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment