Forum


Replies: 3   Views: 3712
Version 6.0 - corrupt documents
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 Shane@CP  · 18-07-2016 - 04:51

I upgraded from version 4.0 to version 6.0 however now when I download a document then open it in Word it says that the document is corrupt.

Even if I just create a blank document link this:

$docx = new CreateDocx();

$docx->createDocxAndDownload($filename);

Why would Word think that the document is corrupt if it is blank?

Posted by admin  · 18-07-2016 - 07:54

Hello,

Which license of phpdocx are you using? You user doesn't have any license tied, only free trials downloads (phpdocx 4 and phpdocx 6 trials).

Regards.

Posted by Shane@CP  · 18-07-2016 - 21:18

We are using the trial version at the moment until we 100% that phpdocx can provide the functionality we require. 

Posted by admin  · 19-07-2016 - 06:56

Hello,

If you create an empty document from scratch, the DOCX output will always be 'corrupted'. You need to add at least one content, use a template or change the default base template from phpdocx.

About your issue, it seems your server is returning a wrong DOCX when downloading it. Maybe your web server has a wrong config to return DOCX mime types. We recommend you to run the included examples and download the DOCX output using an alternative such as FTP just as test; the library is working perfectly.

Regards.