title: http header for downloading Microsoft Word and Excel files
body: <p>I can download my microsoft word successfully if I named it in the filename by default. But if I use $variables to name it. The document extension will be unknown.</p>
  
  <p>Sample:</p>
  
  <pre><code>$No = 1; 
  $Name = 'John'; 
  $Test = 'Science';
  
  //Download header
  $document-&gt;save($doc);
  header('Content-Description: File Transfer');
  header('Content-Type: application/msword');
  header("Content-Disposition: attachment; filename='$No_$Name_$Test.docx");
  header('Content-Transfer-Encoding: binary');
  header('Expires: 0');
  header('Cache-Control: must-revalidate');
  header('Pragma: public');
  header('Content-Length: ' . filesize($doc));
  ob_clean();
  flush();
  readfile($doc);
  </code></pre>
  
  <p>So if i rename my filename as variables. The file download will be without the docx extension. Anyone can advise?</p>
  
  <p>Thanks</p>