Title: Great for small tasks, but strict size limits
Rating: ⭐⭐⭐
Review: I’ve been using ZipOnTheFly for our media management system. It works perfectly 90% of the time—fast, lightweight, and reliable.
However, I recently hit a wall when trying to zip a large batch of log files. I received the error: "total size of requested files is too large for ziponthefly." It appears the library has a hard cap (likely due to memory allocation limits during the streaming process). If you are working with files under 1-2GB, this is a solid choice. If you need to archive massive datasets, you may need to look for a more robust solution or split your files manually before zipping. total size of requested files is too large for ziponthefly
You’re most likely to see this message in:
The quickest workaround is to have users download fewer files at once. For example, instead of selecting 50 files (500MB total), ask them to split into two separate ZIPs of 250MB each. This is often a change in user behavior, not code.
If you are the server administrator or have root access, you can adjust the configuration to allow larger zips. Title: Great for small tasks, but strict size
1. Increase Memory Limit (PHP)
If the file manager runs via PHP (common in cPanel), the script may be hitting the memory_limit.
2. Adjust Web Server Timeout Even if memory is sufficient, the script might be timing out while zipping large files.
3. Use the Command Line (SSH) If you have SSH access, you can bypass the web file manager entirely. This is faster and has virtually no size limits. You’re most likely to see this message in:
The error triggers when the cumulative size of all requested files exceeds a certain threshold. This threshold is not universal; it depends on your server’s configuration. The primary culprits are:
Stream the ZIP in smaller pieces using HTTP range requests. This is complex but possible. Libraries like ZipStream-PHP can send ZIP parts without loading everything into memory.
// ZipStream example (memory-efficient)
$zip = new ZipStream\ZipStream('download.zip');
foreach ($files as $file)
$zip->addFileFromPath($file['name'], $file['path']);
$zip->finish();
Even then, the total size is still bounded by execution time, but memory usage drops dramatically.
Most ZipOnTheFly implementations in PHP use the ZipArchive class. To create the ZIP, PHP must hold a significant portion of the file data in memory. If the total size of requested files exceeds memory_limit (commonly set to 128M or 256M), PHP will abort the process, throwing this error.
Example: If memory_limit = 128M and users select 150MB of files, the error appears.