Filename for export is not accepted
Notice: This thread is very old.
- jik
- Member | 149
Hello,
I export data into file (xml):
public function beforeRender() {
header('Content-Type: application/csv, utf-8');
header("Content-Disposition: attachment;filename=\"$this->file\"");
header('Cache-Control: max-age=0');
}
public function actionEdap($dap_id) {
$this->file = "SomeName.xml";
}
public function renderEdap($dap_id) {
...
}
It works me in a lot of cases (also in the same presenter), but in one case I get only name ‘edap’ instead of defined name. It looks like the procedure actionEdap is masked by something (but it is only once in presenter). Where can be a problem? Is any way to change (or drop) the filename in renderEdap?
- Martk
- Member | 661
Move content in actionEdap to renderEdap or rename beforeRender to startup, btw. you missed call parent::beforeRender()
Documentation: Life cycle of presenter
Last edited by Antik (2016-03-14 11:43)