function webform_exporter_delimited::set_headers in Webform 6.3
Same name and namespace in other branches
- 5.2 webform_export.inc \webform_exporter_delimited::set_headers()
- 6.2 webform_export.inc \webform_exporter_delimited::set_headers()
- 7.4 includes/exporters/webform_exporter_delimited.inc \webform_exporter_delimited::set_headers()
- 7.3 includes/webform.export.inc \webform_exporter_delimited::set_headers()
Overrides webform_exporter::set_headers
1 method overrides webform_exporter_delimited::set_headers()
File
- includes/
webform.export.inc, line 135 - Provides several different handlers for exporting webform results.
Class
Code
function set_headers($filename) {
parent::set_headers($filename);
// Convert tabs.
if ($this->delimiter == "\t") {
$extension = 'tsv';
$content_type = 'text/tab-separated-values';
}
else {
$extension = 'csv';
$content_type = 'text/csv';
}
drupal_set_header("Content-Type: {$content_type}");
drupal_set_header("Content-Disposition: attachment; filename={$filename}.{$extension}");
}