php - JSONP response download as a file? -
when call webservices , response convert jsonp format, @ time response come correctly download file. file format not displayed. download file. try below code.
$result = array( 'result'=>'error', 'errormessage'=>'please enter valid data ); header('content-type: application/jsonp'); return json_encode($result);
i try echo , print replace of return keyword.
$result = array( 'result'=>'error', 'errormessage'=>'please enter valid data ); $this->output->set_content_type('application/json')->set_output(json_encode($result ));
Comments
Post a Comment