Download page content as text or other type.

We can use contentType parameter of page component to specify what kind of data are returned.

This will result plain text which will be opened inside browser.

<apex:page controller="as_WelcomePageController" contentType="text/plain" >

by adding #filename.txt we can force file download wit that content.

<apex:page controller="as_WelcomePageController" contentType="text/plain#filename.txt" >

Avaliable content types are described in wikipedia full list can be found here.


© Paweł Woźniak