Forum


Replies: 7   Views: 3432
Error upgrading from 3.1 to 3.2 - invalid 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 rori  · 23-05-2013 - 17:44

I am trying to update phpdocx to the latest version for our site.  It currently works using version 3.1 Pro and I am attempting to upgrade to 3.2 Pro.



I renamed the folder for the old version and copied in the new (3.2) version into our web application to have it call the new code.  Trying out the site code, the new version gives an error when trying to call addDOCX: 



PHP Warning:  ZipArchive::getFromName() [<a href='ziparchive.getfromname'>ziparchive.getfromname</a>]: Invalid or unitialized Zip object in [...]\phpdocx\classes\CreateDocx.inc on line 7191



The stack trace pointed it at the addDOCX call, which is immediately following a CreateDocx() call:



$phpdocx = new CreateDocx();

$phpdocx->addDOCX('../tmpDocumentHolder/Descriptives.docx');



The zip extension is installed, as you can tell by the result of the provided check.php:



Your PHP version is 5.3.13 => OK

Your Zip extension version is 1.9.1 => OK

Your XSL extension version is 0.1 => OK

Your Tidy extension version is 2.0 => OK



So, I am not sure what to do next in order to get the version upgraded to 3.2.  The docx file we are trying to use with addDOCX worked fine before, and I can open it in a zip program externally so I do not think it is any obvious problem with the source document file.



Any help would be appreciated!


Posted by jorgelj  · 24-05-2013 - 08:45

Hello,



Please run examples/easy/DOCX.php. The issue doesn't seem to be related to your DOCX (tmpDocumentHolder/Descriptives.docx) but to some missing file, did you copy every folder and file included in the package?.



Regards.


Posted by rori  · 24-05-2013 - 15:14

examples/DOCX.php worked fine.



I had included all the files from the install at first, recently I had deleted the pdf folder to save room as we are not using features related to PDF -- it was having the problem before and still is after so I was assuming it did not have an effect.


Posted by jorgelj  · 26-05-2013 - 18:47

Hello,



Seems the error is related to /tmpDocumentHolder/Descriptives.docx file. Can you open this file in WinZIP (WinRAR or any other file archiver) to check if it's a valid ZIP (a DOCX is a ZIP file)?



As you can see in your message:



Invalid or unitialized Zip object



The file is not a valid ZIP.



Regards.


Posted by rori  · 27-05-2013 - 00:04

Yes, I can open it in WinRAR just fine (And it worked fine with the previous version)


Posted by jorgelj  · 27-05-2013 - 09:31

Hello,



Plese contact us (http://www.phpdocx.com/contact) or paste your script and attach the DOCX (a script that we can run on our servers please), we'd like to test it.



Regards.


Posted by i-cre8  · 11-06-2013 - 01:26

I will try and get a test case together for you