Search code examples
phpzend-frameworklivedocx

ZendService\LiveDocx returns zip file instead of docx


I'm using the ZendService\LiveDocx library, but when I run this on our stage server (Linux) and request the format to be docx, it returns me back a zip file rather than the actual document. The zip file consists of XML files describing the document. If I request the format to be PDF it works fine. This works fine in my local development environment (Windows 7) when I try to generate a docx document.

Any ideas why the LiveDocx service would return a zip file instead of the actual document?


Solution

  • The zip file consists of XML files describing the document.

    That's how .docx files work.

    A .docx in fact is a zip file, so you can simply rename them according to your needs.

    You can try this by taking a "good looking" docx file and rename it to .zip, then extract.

    The solution for your problem is to rename the file from .zip to .docx before exposing to the user as a download.