crocofile
crocofile copied to clipboard
ZIP file generation timeout
Hi,
When my Crocofile directories get too big, the ZIP file download produces a corrupt (truncated) file. For example, I end up with a 103MB ZIP file while manually producing a zip file with ZipStream results in a 188MB file.
In the error log, I find:
PHP Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/crocofile/inc/zipstream.php on line 372
After looking at the issue, I think it is probably best to disable timeout for ZIP files. This is only possible when not using safe mode.
===================================================================
--- index.php (revision 24)
+++ index.php (working copy)
@@ -38,6 +38,7 @@
exit();
case 'zip':
require 'inc/zipstream.php';
+ ini_get('safe_mode') or set_time_limit(0);
$zip = new ZipStream("$USER.zip",array('large_file_size'=>1024*1024));
$files = glob($CONF->get('uploaddir').'/'.$USER.'/*');
foreach($files as $file){
This resolves the problem for me.