Hello,
I try to download a file (*.docx) which was generated with PHPWord and stored in a folder of the application server. The following code
header(‘Content-Type: application/octet-stream’);
header(‘Content-Length:’ .filesize($filename));
header(‘Content-Disposition: attachment; filename=’ .basename($filename));
header(‘Content-Transfer-Encoding: binary’);
readfile($filename);
appends the file to the HTML-code of the form application. The result is worthless but it cannot be read with any host-application (Word, OpenOffice etc.).
Is there anybody who can help me?
Hans