I'm trying to add a large number of pictures to a zip file and at some point, the _add_date private function that concatenates the string data fails. What kind of work around could I use ? Should I increase the compression level ? Can I just append the files one by one to the archive ?
Here's the method that fails.
function _add_data($filepath, $data, $file_mtime, $file_mdate)
(...)
$this->zipdata .=
"\x50\x4b\x03\x04\x14\x00\x00\x00\x08\x00"
.pack('v', $file_mtime)
.pack('v', $file_mdate)
.pack('V', $crc32)
.pack('V', $compressed_size)
.pack('V', $uncompressed_size)
.pack('v', strlen($filepath)) // length of filename
.pack('v', 0) // extra field length
.$filepath
.$gzdata; // "file data" segment
(...)
}