Welcome Guest, Not a member yet? Register   Sign In
Zip library "Allowed memory size"
#4

just create your own function to add them to a zip file one by one rather than having CI do the whole thing in one pass

https://www.php.net/manual/en/class.ziparchive.php

not tested the following but you get the idea. This is what i did to get around the same issue

Code:
$zip = new ZipArchive();
$path_to_zip_file = '/home/path/to/file/my_zip_file.zip';
$array_of_files_to_save = array('/home/files/file1.jpg','/home/files/file3.jpg','/home/files/file3.jpg'); // create an array of files to save

// if zip does not exist, create it, otherwise open and add to it
$zip->open($path_to_zip_file , ZipArchive::CREATE):

// loop through and add each file
foreach($array_of_files_to_save AS $key => $value):
$zip->addFile($value)
endforeach;

// close the zip file
$zip->close();
Reply


Messages In This Thread
Zip library "Allowed memory size" - by ZoeF - 01-19-2020, 01:10 PM
RE: Zip library "Allowed memory size" - by ZoeF - 01-20-2020, 12:20 AM
RE: Zip library "Allowed memory size" - by futurewebs - 01-20-2020, 02:00 AM
RE: Zip library "Allowed memory size" - by ZoeF - 01-20-2020, 09:28 AM
RE: Zip library "Allowed memory size" - by ZoeF - 01-21-2020, 07:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB