I need to stream file content (such as images and other mime types) from a Lumen resource server to a Laravel client server. I know in Laravel I can use:
$headers = ['Content-Type' => 'image/png'];
$path = storage_path('/mnt/somestorage/example.png')
return response()->file($path, $headers);
However, the file
method is absent in Laravel\Lumen\Http\ResponseFactory
.
Any suggestions are very welcome.
In Lumen you can use Symfony's
BinaryFileResponse
.You can find the documentation here.