You are here

public function webform_exporter_excel_delimited::set_headers in Webform 7.4

Provide headers to the page when an export file is being downloaded.

Parameters

string $filename: The name of the file being downloaded, for example, export.xls.

Overrides webform_exporter_delimited::set_headers

File

includes/exporters/webform_exporter_excel_delimited.inc, line 53

Class

webform_exporter_excel_delimited
The Excel exporter currently is just a tab-delimited export.

Code

public function set_headers($filename) {
  drupal_add_http_header('Content-Type', 'application/x-msexcel');
  drupal_add_http_header('Content-Disposition', 'attachment; filename=' . $this
    ->get_filename($filename));
  drupal_add_http_header('Pragma', 'public');
  drupal_add_http_header('Cache-Control', 'max-age=0');
}