-
-
Save IonutBajescu/27c43a095ebc2442bd20 to your computer and use it in GitHub Desktop.
stream binary
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
<?php | |
// ... | |
/** | |
* @Get("view/{file}", as="files.view") | |
*/ | |
public function view(File $file) | |
{ | |
$response = new BinaryFileResponse($file->getAbsolutePath()); | |
$response->headers->set('Content-Disposition', 'inline; filename="' . $file->real_filename . '"'); | |
return $response; | |
} | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment