I have a FAPI form that collects some information from the user, then generates a CSV file. The intent is when the user clicks 'export' on the form, the CSV is downloaded straight away.
However, when the submit handler calls the CSV-generating function, the form just redirects, rather than serving the CSV.
Is there any way to make this form serve the CSV to the user directly, without generating a temporary file?