Creating Large Zip Archives on the Fly
Posted: Fri Feb 09, 2007 7:16 pm
I'm currenly working on a project that requires the creation of a zip file, on the fly in php, that contains multiple mp3 files from 2MB to 4MB per file, with a maximum number of files being between 10 and 15 per archive. Once created the file is downloaded to the client and then deleted.
The PHP classes I've tried (like phpZIP PRO) all store the contents of the zip in memory. I realize that by increasing post_file_size and upload_max_filesize in php.ini I can probably get it to work in development, but my concern is that in production it will be too much of a load.
Are there any methods of creating large zip archives on the fly that don't require the whole file to be loaded into memory? I've read about using tar or gzip through the system() function, but am not sure that will help.
Linux/Apache/PHP 4.4.4
Thanks
The PHP classes I've tried (like phpZIP PRO) all store the contents of the zip in memory. I realize that by increasing post_file_size and upload_max_filesize in php.ini I can probably get it to work in development, but my concern is that in production it will be too much of a load.
Are there any methods of creating large zip archives on the fly that don't require the whole file to be loaded into memory? I've read about using tar or gzip through the system() function, but am not sure that will help.
Linux/Apache/PHP 4.4.4
Thanks