php - Download a PDF file instead of displaying it with CodeIgniter -


i generating pdf file using codeigniter , r&os pdf class. problem pdf displayed browser. instead want downloaded. here code :

$this->load->library('cezpdf');          $data['users'] = $this->user->get_all_ayant_droits();          foreach($data['users'] $user) {             $db_data[] = array('name' => $user->nom, 'department' => $user->department, 'status' => $user->status);         }          $col_names = array(             'name' => 'noms et prenoms',             'department' => 'département',             'status' => 'status'         );          $this->cezpdf->eztable($db_data, $col_names, 'ayant droit base loisirs de kribi', array('width'=>550));         $this->cezpdf->ezstream();   

what missing controller send file download ?

you can pass argument function ezstream

$this->cezpdf->ezstream(array $options); 

$options 'compress' => 0/1 enable compression. compression level please use $this->options['compression'] = @ first point. default: 1 'download' => 0/1 display inline (in browser) or download. default: 0


Comments