2

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?

Adrian Walls
  • 852
  • 3
  • 19
  • 31

1 Answers1

3

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.

Daniel W.
  • 31,164
  • 13
  • 93
  • 151
  • 1
    Thanks Dan. I've discovered in the interim that this is because of S3 and not Livedocx. These are being stored on S3 with mime type application/zip. I need to store these correctly in S3 with correct mime type. – Adrian Walls Jun 04 '14 at 14:01
  • 1
    @AdrianWalls Mime should be `application/vnd.openxmlformats-officedocument.wordprocessingml.document` I think. – Daniel W. Jun 04 '14 at 14:03