Forum


Replies: 3   Views: 3536
Createdocxanddownload word is corrupted
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 243127387@qq.com  · 24-10-2015 - 06:32

Hi:

  When I call createDocx the file output is fine but when I call createDocxAndDownload Word 2007 Windows 7 Home Premium x64 displays an error message saying that the file is corrupted.

Any ideas?  Thanks.

 

Posted by 243127387@qq.com  · 26-10-2015 - 01:31

Hi :      

     My server version is Apache 2.4.4, PHP version is 5.4.12, mysql version is 5.6.12.   windows  is win7 64 bit.  Looking forward to your reply! Thanks.

Posted by 243127387@qq.com  · 26-10-2015 - 02:09

Hi:

  I look at the http://www.phpdocx.com/en/forum/default/topic/347, before CreateDocxAndDownload, add a statement: ob_clean (); , download a word can correctly display, thank you very much for the Forum.

Posted by admin  · 26-10-2015 - 08:41

Hello,

If you need to use ob_clean to get a correct DOCX file, it's because your server is adding some string into it; maybe some notice, warning or header. Although you can use this function to solve it, we recommend you to remove that line, check your server logs, edit the DOCX using an HEX editor and check its content.

Regards.