Forum


Replies: 1   Views: 3154
Word complains that i have a corrupted docx file
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 koopie66  · 05-10-2017 - 18:19

Hi.

Hi installed phpdoc the trial version to see if it fits my needs. I created a document, but when I save it and I ant to open it it tells me that the file is corrupt.

If I download the file via FTP I don't get this error. I also noted that the downloaded file has a bigger size than the file via FTP

I use the following code to perform a download

=====

header('Content-type: application/vnd.openxmlformats-officedocument.wordprocessingml.document');
    header('Content-Disposition: attachment; filename="document.docx"');
    header('Expires: 0');
    header("Content-Length: " . filesize('document.docx'));
    header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    header('Pragma: public');
    ob_clean();
    flush();
    readfile('document.docx');

 Can you please give some help in how to solve this issue, its really blocking my evaluation of your software

Kind regards Hans