public function exportAction() { try { $objectId = $this->getParam("objectId"); $object = Object_Abstract::getById($objectId); $exportFile = PimPon_Object_Export::doExport($object); ob_end_clean(); header("Content-type: application/json"); header("Content-Disposition: attachment; filename=\"pimponexport.objects." . $object->getKey() . ".json\""); echo file_get_contents($exportFile); exit; } catch (Exception $ex) { Logger::err($ex->getMessage()); $this->_helper->json(array("success" => false, "data" => 'error'), false); } $this->getResponse()->setHeader("Content-Type", "text/html"); }