I am trying to make a zip file in php. The code:
header('Content-Type: application/zip');
header('Content-Length: ' . filesize($file));
header('Content-Disposition: attachment; filename="file.zip"');
The downloaded file contains only a few bytes. This error message is:
<br />
<b>Fatal error</b>: Allowed memory size of 16777216 bytes exhausted (tried to allocate 41908867 bytes) in <b>/var/www/common_index/main.php</b> on line <b>217</b><br />
I do not want to increase memory_limit in php.ini. What are the alternative ways to correctly display large zip files without using global settings?
tanon source
share