From 74a08d9a7ba0a659c49a44a41b7455a86342eaf9 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 21 Nov 2006 15:08:18 +0000 Subject: [PATCH] changing the inline delivery method now the 20th time - gosh. git-svn-id: file:///svn/phpbb/trunk@6626 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/download.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/phpBB/download.php b/phpBB/download.php index 64d147fa79..d3f600abdb 100644 --- a/phpBB/download.php +++ b/phpBB/download.php @@ -245,8 +245,19 @@ function send_file_to_browser($attachment, $upload_dir, $category) header("Content-Length: $size"); } - // Might not be ideal to store the contents, but file_get_contents is binary-safe as well as the recommended method - echo @file_get_contents($filename); + // Try to deliver in chunks + @set_time_limit(0); + + $fp = @fopen($filename, 'rb'); + + if ($fp !== false) + { + while (!feof($fp)) + { + echo fgets($fp, 8192); + } + fclose($fp); + } flush(); exit;