mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-05-19 22:51:30 +00:00
Fixed streamed outputs in more extreme scenarios
Fixes hitting memory limits where downloaded file sizes are much greater than memory limit. Stopping and flushing output buffer seemed to stop limits causing issues when fpassthru is used. Tested with 24M memory limit and 734M file
This commit is contained in:
parent
82e8b1577e
commit
6749faa89a
1 changed files with 1 additions and 0 deletions
|
@ -127,6 +127,7 @@ abstract class Controller extends BaseController
|
|||
protected function streamedDownloadResponse($stream, string $fileName): StreamedResponse
|
||||
{
|
||||
return response()->stream(function() use ($stream) {
|
||||
ob_end_clean();
|
||||
fpassthru($stream);
|
||||
fclose($stream);
|
||||
}, 200, [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue