Forum


Replies: 6   Views: 4711
[docx v2.6] invalid or unitialized zip object
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by js  · 17-09-2012 - 08:45

Hi,

I would like to use the template function in order to make life easier for my end users. However, as soon as I start using addTemplate('path/template.docx') the following warnings show up:
[quote]
Warning: ZipArchive::addFile() [ziparchive.addfile]: Invalid or unitialized Zip object in /var/www/view_extensions/php_docx/v2.6_pro/classes/CreateDocx.inc on line 6148
(...)
Warning: ZipArchive::close() [ziparchive.close]: Invalid or unitialized Zip object in /var/www/view_extensions/php_docx/v2.6_pro/classes/CreateDocx.inc on line 4314
[/quote]

The files itself get created and seem to be OK (no error when opening them etc).

Any help would be appreciated.

Posted by Graff  · 11-04-2013 - 12:13

Hey.

You need to enable Zip extension in your php.ini file and restart web server.

Posted by js  · 11-04-2013 - 12:13

Hi!

zip is activated and works fine - the messages only show up when I use the "addTemplate" function. If I just create docx files everything is working as expected.

Kind regards,
Johannes

Posted by admin  · 11-04-2013 - 12:13

Hello,

Seems your DOCX is not a valid ZIP file. Please contact us and send your docx file to test it.

Regards.

Posted by js  · 11-04-2013 - 12:13

Hi,

I use a very basic docx file in the meanwhile which only contains the names of the var's. That should not be the issue... Howerver, I have uploaded the document for your inspection: http://www.security-blog.eu/wp-content/uploads/2012/09/temp.docx

Furthermore, the first document in the loop is getting created just as it should and based on the (basic or complex) template.

Kind regards,
Johannes

Posted by admin  · 11-04-2013 - 12:13

Hello,

Please check

http://www.phpdocx.com/help/forum?vasthtmlaction=viewtopic&t=291.0

Regards.