public function sendToBrowserDownload($filename) { $this->epilogue(); $filename = Piwik_ReportRenderer::appendExtension($filename, "html"); Piwik::overrideCacheControlHeaders(); header('Content-Description: File Transfer'); header('Content-Type: text/html'); header('Content-Disposition: attachment; filename="' . str_replace('"', '\'', basename($filename)) . '";'); header('Content-Length: ' . strlen($this->rendering)); echo $this->rendering; }
public function sendToBrowserInline($filename) { $filename = Piwik_ReportRenderer::appendExtension($filename, self::PDF_CONTENT_TYPE); $this->TCPDF->Output($filename, 'I'); }
protected static function sendToBrowser($filename, $extension, $contentType, $content) { $filename = Piwik_ReportRenderer::appendExtension($filename, $extension); Piwik::overrideCacheControlHeaders(); header('Content-Description: File Transfer'); header('Content-Type: ' . $contentType); header('Content-Disposition: attachment; filename="' . str_replace('"', '\'', basename($filename)) . '";'); header('Content-Length: ' . strlen($content)); echo $content; }
public function sendToBrowserDownload($filename) { $filename = Piwik_ReportRenderer::appendExtension($filename, "pdf"); $this->TCPDF->Output($filename, 'D'); }