json problem (valums ajax uploader with zend framework)
ajax, jquery, json, mime-types, zend-framework
Solution
You can affect the response by using the response object. From within your controller:
$content = Zend_Json::encode(array('Foo' => 'Nice', 'Bar' => 'Vice'));
$this->getResponse()
->setHeader('Content-Type', 'text/html')
->setBody($content)
->sendResponse();
exit();
Problem
I am using the ajax uploader and the Zend Framework. The Problem is when I am using the json response for the onSubmit. With `$this->getHelper('Json')->sendJson($data);` I only get a saveas dialog. The problem is that the uploader expects every responste to be "text/html" but the json helper sends "application/json" as mimetype. With a usual response every thing works fine, but I need to send some information back to the script. So how can I say Zend that it should send jsondata with the mimetype "text/html"?