Filename for export is not accepted

Notice: This thread is very old.
jik
Member | 146
+
0
-

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?

CZechBoY
Member | 3608
+
0
-

Find usages of $this->file.

Martk
Member | 651
+
0
-

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)