Friday, September 30, 2016

[php][Resolved] ERR_CONTENT_DECODING_FAILED

To solve the problem, these things i did :

1) Turn on zlib.output_compression in your php.ini, default is Off, edit it to On.


2) If you using notepad++ for coding, save the file cause problem without BOM.


3) If after finishing (1)  and (2) still is not work, check your php syntax. For me case it's strange that i use return syntax to replace echo , the problems solved.
from
public function uploadImage(){
    //To do sth
    $response['resultCode'] = "s";
    echo json_encode($response);
}
to
public function uploadImage(){
    //To do sth
    $response['resultCode'] = "s";
    return json_encode($response);
}

Reference

https://stackoverflow.com/questions/14039804/error-330-neterr-content-decoding-failed

No comments :

Post a Comment