ramesh
ramesh

Reputation: 4082

Create ZIP file in php , windows

I have to create a zip file using php. The files are located in a directory of my web server. I have to add these files ( dynamically ) and make a zip file.

Working perfect in php with small files but when I tried to make zip using files greater than 200 MB I will take more time to create zip.

So is there is any way to make a zip file using windows system command, which can run through PHP ? So that we can create zip files easily and quickly with out memory loss .

Please help

Upvotes: 1

Views: 1085

Answers (1)

CodeCaster
CodeCaster

Reputation: 151588

You could try to implement a queue of some kind, perhaps in your database. You enqueue zip operations, while on the background a cron job of some kind does the zipping, and notifies your queue when it's finished.

This won't decrease processing time, but since zipping is a CPU and I/O heavy operation, it probably can't be sped up much. Using this technique you don't have to let your user wait until zipping is done, you could for example simply send an e-mail (with the link to the created zip file) when it's done.

Upvotes: 1

Related Questions