title: Can't download a word file
body: <p>Can you tell me what is wrong with my headers? My download is not effective. I use PHPWord library but I don't think it's a problem</p>
  
  <pre><code>&lt;?php
  
      require_once 'PHPWord.php';
      $PHPWord = new PHPWord();
  
      $section = $PHPWord-&gt;createSection();
      $wordText = utf8_encode($_REQUEST['TEXT']);
  
      $section-&gt;addText($wordText);
  
      $objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
      //$objWriter-&gt;save('helloWorld.docx');
      $path = 'tmp/kikou2.docx';
      $objWriter-&gt;save($path);
      //download code
      header('Content-Description: File Transfer');
      header('Content-Type: application/octet-stream');
      header('Content-Disposition: attachment; filename=' .$path);
      header('Content-Transfer-Encoding: binary');
      header('Expires: 0');
      header('Content-Length: ' . filesize($objWriter));
      readfile($objWriter);
      unlink($objWriter); // deletes the temporary file
      exit;
  
  
  ?&gt;
  </code></pre>
  
  <p>Thanks</p>