From 634f9d38413ea43b89b37a6e4641070a851120e6 Mon Sep 17 00:00:00 2001 From: prashantsinalkar Date: Tue, 27 Dec 2016 15:30:30 +0530 Subject: added new functions to fix the zip download issues --- download.inc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/download.inc b/download.inc index d33ad1a..f9ed6a1 100755 --- a/download.inc +++ b/download.inc @@ -96,6 +96,9 @@ function textbook_companion_download_example() header('Content-Type: application/zip'); header('Content-disposition: attachment; filename="EX' . $example_data->number . '.zip"'); header('Content-Length: ' . filesize($zip_filename)); + ob_end_flush(); + ob_clean(); + flush(); readfile($zip_filename); unlink($zip_filename); } //$zip_file_count > 0 @@ -169,6 +172,9 @@ function textbook_companion_download_chapter() header('Content-Type: application/zip'); header('Content-disposition: attachment; filename="CH' . $chapter_data->number . '.zip"'); header('Content-Length: ' . filesize($zip_filename)); + ob_end_flush(); + ob_clean(); + flush(); readfile($zip_filename); unlink($zip_filename); } //$zip_file_count > 0 -- cgit