title: Excel file is not downloading using PHPExcel library with dynamic data
body: <p>When I click on the export button, it goes to my <code>export_inquiry()</code> function and I have set my array which is coming from DB table and downloads the excel file with this dynamic array data. But, right now it throws me the error of
  This site can’t be reached
  The webpage at <a href="http://www.example.com/project_name/admin/order/export_inquiry" rel="nofollow noreferrer">http://www.example.com/project_name/admin/order/export_inquiry</a> might be temporarily down or it may have moved permanently to a new web address.</p>
  
  <blockquote>
    <p>ERR_INVALID_RESPONSE.</p>
  </blockquote>
  
  <p>I am using <code>PHPExcel</code> library in <code>CodeIgniter</code> for downloading the excel file. Below is my code for excel export.</p>
  
  <pre><code>public function export_inquiry()
  {
      ini_set('display_startup_errors',1);
      ini_set('display_errors',1);
      error_reporting(E_ALL);
  
  
      $this-&gt;load-&gt;library('phpexcel/PHPExcel');
      $object = new PHPExcel();
  
        $object-&gt;setActiveSheetIndex(0);
  
        $table_columns = array("DATE", "ID", "CustomerReference", "InvoiceName", "PickUpCity", "PickUpDate");
  
        $column = 0;
  
        foreach($table_columns as $field)
        {
         $object-&gt;getActiveSheet()-&gt;setCellValueByColumnAndRow($column, 1, $field);
         $column++;
        }
  
        $employee_data  =array(
          array(
              'order_date' =&gt; '2018-05-23 22:35:36',
              'id' =&gt; 17,
              'customerreference' =&gt; '',
              'invoice_name' =&gt; 'Troy Design and Manufacturing',
              'pick_up_city' =&gt; 'Gothenburg',
              'pick_up_date' =&gt; '2018-07-02'
          ),
          array(
              'order_date' =&gt; '2018-05-28 02:51:58',
              'id' =&gt; 19,
              'customerreference' =&gt; '',
              'invoice_name' =&gt; 'Hollingsworth Distribution Systems',
              'pick_up_city' =&gt; 'Gothenburg',
              'pick_up_date' =&gt; '2018-07-02'
          ),
          array(
              'order_date' =&gt; '2018-05-28 04:39:23',
              'id' =&gt; 20,
              'customerreference' =&gt; '',
              'invoice_name' =&gt; 'Motherson Automotive (FSP-1)',
              'pick_up_city' =&gt; 'Gothenburg',
              'pick_up_date' =&gt; '2018-07-02'
          )
      );
  
        $excel_row = 2;
        foreach($employee_data as $key =&gt; $row)
        {
         $object-&gt;getActiveSheet()-&gt;setCellValueByColumnAndRow(0, $excel_row, $row['order_date']);
         $object-&gt;getActiveSheet()-&gt;setCellValueByColumnAndRow(1, $excel_row, $row['id']);
         $object-&gt;getActiveSheet()-&gt;setCellValueByColumnAndRow(2, $excel_row, $row['customerreference']);
         $object-&gt;getActiveSheet()-&gt;setCellValueByColumnAndRow(3, $excel_row, $row['invoice_name']);
         $object-&gt;getActiveSheet()-&gt;setCellValueByColumnAndRow(4, $excel_row, $row['pick_up_city']);
         $object-&gt;getActiveSheet()-&gt;setCellValueByColumnAndRow(5, $excel_row, $row['pick_up_date']);
         $excel_row++;
        }
  
        $object_writer = PHPExcel_IOFactory::createWriter($object, 'Excel5');
        header('Content-Type: application/vnd.ms-excel');
        header('Content-Disposition: attachment;filename="Employee Data.xls"');
        $object_writer-&gt;save('php://output');
  }
  </code></pre>
  
  <p>Can anyone help me with this issue?
  Thanks in advance.</p>