I get this response:
{"success":true,"errorCode":-1,"error":""}
No HTML inside the JSON, but the js say its entered:
uncaught exception: You're trying to decode an invalid JSON String: <pre>{"success":true,"errorCode":-1,"error":""}</pre>
The code: http://www.pasteall.org/30057/javascript
The issue has been fixed that so odd seem like when you upload a file the ExtJS submit can't handle the json response. If you make at html and convert violà you got at.
$this -> output -> set_content_type('text/html');
that all the problem
The behaviour you experienced is actually documented (quite well buried, though) in ExtJS API docs - see description of Ext.form.Basic.hasUpload() method.
In short, file uploads are not performed by typical Ajax XMLHttpRequests
. It uses a hidden iframe
element instead. As a result, to quote ExtJS documentation:
If the server is using JSON to send the return object, then the Content-Type header must be set to "text/html"...
Which is exactly how you seemed to eventually solve your problem - so, this explains why it indeed works. So it's "not a bug, but a feature". :-D
It's hard to analyze the problem without seeing the code, so if you can add your code piece of client side, it may help.
Anyway, it seems that the result is returned in html format, i.e. contains non json data. Check why tags are included inside the result.
Check also the configuration of your server's page - it should be configured properly so to return JSON format.
It also explains why your result status is success. it is because the call to server operation was succeeded, i.e. the result was return to client without any error.
Now, after the server returned results to client, the store tries to operate the resulted data, but without success since the content is not in JSON format.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With