title: PHPExcel: Downloading spreadsheet
body: <p>For a long time now, I have been trying to give users the ability to 'save as' or 'open' the created spreadsheet using the dialog box.</p>
  
  <p>This is what I tried, I am getting no errors, just gibberish characters on the screen:</p>
  
  <pre><code>//CREATE SPEADSHEET
  
  $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
  
  // We'll be outputting an excel file
  header('Content-type: application/vnd.ms-excel');
  
  // It will be called file.xls
  header('Content-Disposition: attachment; filename="file.xls"');
  
  // Write file to the browser
  $objWriter-&gt;save('php://output');
  </code></pre>
  
  <p>I would greatly appreciate any help with figuring this one out.</p>