aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/download.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/download.php')
-rw-r--r--phpBB/download.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/phpBB/download.php b/phpBB/download.php
index 382c528db9..a1ee73f808 100644
--- a/phpBB/download.php
+++ b/phpBB/download.php
@@ -322,7 +322,20 @@ function send_avatar_to_browser($file)
header("Content-Length: $size");
}
- readfile($file_path);
+ if (@readfile($file_path) === false)
+ {
+ $fp = @fopen($file_path, 'rb');
+
+ if ($fp !== false)
+ {
+ while (!feof($fp))
+ {
+ echo fread($fp, 8192);
+ }
+ fclose($fp);
+ }
+ }
+
flush();
}
else
@@ -447,6 +460,10 @@ function send_file_to_browser($attachment, $upload_dir, $category)
}
fclose($fp);
}
+ else
+ {
+ @readfile($filename);
+ }
flush();
exit;