Force Download CSV File

        $html =  $this->load->view('download_report', $result, TRUE);
        header("Content-Type: application/xls");
        header("Content-Disposition: attachment; filename=test.xls");
        header("Pragma: no-cache");
        header("Expires: 0");
        echo $html; 

No comments:

Post a Comment