This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

alexey.isavnin989
alexey.isavnin989

I'm trying to make a dynamically formed downloadable text documents. In order to do that created an empty layout ascii.htm:

{% page %}

and I formate ascii text in the download.htm page. But in order to make it downloadable with a pop-up save window I need to change the http headers in the response into content-type: text/csv. How can I do that?

Last updated

alexey.isavnin989
alexey.isavnin989

For now I made it the following way: I created a custom view ascii.htm in plugins/me/my_plugin/views/. I added the path to it in the app/config/view.php. And returned the content in the onRun() method of my component class like that:

return Response::make(View::make('ascii', array('data', $data)))->header('Content-type', 'text/csv');

It works but the template ascii.htm is not editable through the backend. Does anyone have a prettier solution?

Last updated

1-2 of 2

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.