Skip to content
Advertisement

Invalid or unitialized Zip object

JavaScript

I am getting Warning: ZipArchive::addFile() [function.ZipArchive-addFile]: Invalid or unitialized Zip object. what could be problem? I tried many methods but in vain. I am able to create and initiate download when I select one file. However, I get above error when I select more than one file.

Advertisement

Answer

The power of indenting correctly!

You are closing your zip file inside your loop.

If I re-format your code it becomes obvious.

Corrected code follows:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement