Skip to content

Commit d866b8d

Browse files
author
Mark Williams
committed
Fix large file buffering
1 parent 9bc86d5 commit d866b8d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

api/src/Page/Download.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,9 @@ function _get_autoproc_attachments()
256256
*/
257257
function _get_file($id, $file)
258258
{
259+
// Remove all buffers
260+
while (ob_get_level() > 0) ob_end_clean();
261+
259262
$filesystem = new Filesystem();
260263

261264
$filename = $file['FILEPATH'] . '/' . $file['FILENAME'];
@@ -276,7 +279,6 @@ function _get_file($id, $file)
276279
// Read the file in 8KB chunks and send them
277280
while (!gzeof($fileHandle)) {
278281
echo gzread($fileHandle, 8192);
279-
if (ob_get_level()) ob_flush();
280282
flush();
281283
}
282284
gzclose($fileHandle);

0 commit comments

Comments
 (0)