Generate the file contents for an export of this template, using the specified type. This generates a string of binary data, which can be sent in an HTTP file response. The controller that exposes the download does that, and sets file name and mine type etc. This just generates the data.