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

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -