PDA

View Full Version : ExtJs3. Defect when the upload file



Andr
8 Nov 2011, 9:09 PM
To upload a file using inputType: 'file', and for a form prescribed fileUpload: true. Everything works fine, the file is saved. But after saving the file block success (from ajax request) is not satisfied. Ie all the stops to waitMsg: 'Saving Data ...'.

What could be wrong?

mitchellsimoens
9 Nov 2011, 5:56 AM
Did you return {success : true} or anything?

Andr
9 Nov 2011, 9:19 PM
Yes, return:

$this->getResponse()->setBody(Zend_Json::encode(array('success'=>true,'msg'=>"")));

Andr
9 Nov 2011, 9:38 PM
what could be wrong?

Andr
9 Nov 2011, 9:38 PM
displays an error


missing} in XML expression - (
apparently the answer must be no json and xml

Andr
9 Nov 2011, 11:08 PM
somehow helped change content-type to application / json to text / html

Example for ZF:


public function preDispatch() {
$this->_helper->viewRenderer->setNoRender();
$this->_helper->getHelper('layout')->disableLayout();

$this->getResponse()->setHeader('Content-Type',
'text/html; charset=utf-8'); // here
Zend_Registry::set("is_json_response", true);