Welcome Guest, Not a member yet? Register   Sign In
set_header() file download problem
#5

It's not a bug. You just need to learn how to use the Output class. Look at http://www.codeigniter.com/user_guide/li...utput.html, there's code example. You need to call _display() before you call exit.

PHP Code:
$response = array('status' => 'OK');

$this->output
        
->set_status_header(200)
 
       ->set_content_type('application/json''utf-8')
 
       ->set_output(json_encode($responseJSON_PRETTY_PRINT JSON_UNESCAPED_UNICODE JSON_UNESCAPED_SLASHES))
 
       ->_display();
exit; 
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply


Messages In This Thread
set_header() file download problem - by Rashid - 12-29-2015, 02:38 AM
RE: set_header() file download problem - by includebeer - 12-29-2015, 09:22 AM



Theme © iAndrew 2016 - Forum software by © MyBB