You are here

function ViewsDataExportExporterDOC::get_headers in Views data export 7.4

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

Parameters

$filename: The name of the file being downloaded. e.g. export.xls.

Overrides ViewsDataExportExporter::get_headers

File

exporters/views_data_export_exporter_doc.inc, line 77

Class

ViewsDataExportExporterDOC
This exporter creates a DOC file readable by Microsoft Word. The content is an HTML table, as used by the old XLS export mechanism.

Code

function get_headers($filename) {
  $headers = parent::get_headers($filename);
  $headers['Content-Type'] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
  $headers['Content-Disposition'] = "attachment; filename={$filename}.doc";
  return $headers;
}