From 9713d38078e0354b47d12fb22af6d453c9941b40 Mon Sep 17 00:00:00 2001 From: Gamesh Date: Mon, 9 Dec 2013 08:53:11 +0200 Subject: [PATCH] [*] FO: now you can download files >1G without running into max execution limitation when reading large files ( >1G ), you often get max execution timeout error, this fix will prevent this. --- controllers/front/GetFileController.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/controllers/front/GetFileController.php b/controllers/front/GetFileController.php index d89f6c109..84e1fdf16 100644 --- a/controllers/front/GetFileController.php +++ b/controllers/front/GetFileController.php @@ -278,6 +278,8 @@ class GetFileControllerCore extends FrontController header('Content-Type: '.$mimeType); header('Content-Length: '.filesize($file)); header('Content-Disposition: attachment; filename="'.$filename.'"'); + //prevents max execution timeout, when reading large files + set_time_limit(0); $fp = fopen($file, 'rb'); while (!feof($fp)) echo fgets($fp, 16384);