title: making phpexcel directory save to download?
body: <p>How can I make it possible for a user choose where to save the file like its kind of download you know, here is the code below: </p>
  
  <pre><code>echo date('H:i:s').' Set title row bold'.EOL;
  $objPHPExcel-&gt;getActiveSheet()-&gt;getStyle('A1:F1')-&gt;getFont()-&gt;setBold(true);
  
  // Set autofilter
  echo date('H:i:s').' Set autofilter'.EOL;
  // Always include the complete filter range!
  // Excel does support setting only the caption
  // row, but that's not a best practise...
  $objPHPExcel-&gt;getActiveSheet()-&gt;setAutoFilter($objPHPExcel-&gt;getActiveSheet()-           &gt;calculateWorksheetDimension());
  
  // Set active sheet index to the first sheet, so Excel opens this as the first sheet
  $objPHPExcel-&gt;setActiveSheetIndex(0);
  
  // Save Excel 2007 file
  echo date('H:i:s') , " Write to Excel2007 format" , EOL;
  $callStartTime = microtime(true);
  
  $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
  $objWriter-&gt;save(str_replace(__FILE__, 'C:/DOSTX.xlsx', __FILE__));
  
  $callEndTime = microtime(true);
  $callTime = $callEndTime - $callStartTime;
  
  echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx',     pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
  echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
  
  // Echo memory usage
  
  echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024)  , " MB" , EOL;
  
  // Save Excel 95 file
  echo date('H:i:s') , " Write to Excel5 format" , EOL;
  $callStartTime = microtime(true);
  
  $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
  $objWriter-&gt;save(str_replace('.php', '.xls', __FILE__));
  $callEndTime = microtime(true);
  $callTime = $callEndTime - $callStartTime;
  ECHO $filename= str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) ,     EOL;
  echo date('H:i:s') , " File written to " , str_replace('.php', '.xls',    pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
  echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
  
  // Echo memory usage
  
  echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024)  , " MB" , EOL;
  
  
  // Echo memory peak usage
  
  echo date('H:i:s').' Peak memory usage: '.(memory_get_peak_usage(true) / 1024 / 1024).'   MB'.EOL;
  
  // Echo done
  echo date('H:i:s').' Done writing files'.EOL;
  
  echo "&lt;script&gt;alert('File saved at drive C')&lt;/script&gt;";
  </code></pre>
  
  <p>I've done many headings before but doesnt just work it does with phpoutput but excel is not acceptable output, excel file cannot be read as what I want it to be output please help me.</p>