nayen — 2013-01-07T04:44:11-05:00 — #1
I know that you can zip and download files/folders with PHP, I actually have a script that does this. The script uses ZipArchive class which requires PHP's Zip extension to be installed/activated.
Is it possible to have a "zip & download" script which doesn't require that extension?
Thanks for any ideas.
vectorialpx — 2013-01-07T05:05:56-05:00 — #2
You may try the unzip UNIX command, and use it with exec or
nayen — 2013-01-08T10:12:16-05:00 — #3
No idea what that does but I am not trying to unzip, I am trying to zip and download.
I found another script that uses exec() function of PHP but it doesn't work if safe mode is enabled. I may use that but I am still looking for alternative options.
vectorialpx — 2013-01-09T11:03:26-05:00 — #4
My bad, I wanted to say
zip but, with safe-mode enabled...
Without exec or passthru or "` operator", I cannot see a solution - you need an external program to do the job.
So, you may try
exec("zip -r output/files.zip path/to/dir");
Do it with error_reporting(E_ALL) so you'll know for sure if it works.