Piwik\ReportRenderer::sendToBrowser PHP Method

sendToBrowser() protected static method

protected static sendToBrowser ( $filename, $extension, $contentType, $content )
    protected static function sendToBrowser($filename, $extension, $contentType, $content)
    {
        $filename = ReportRenderer::makeFilenameWithExtension($filename, $extension);
        ProxyHttp::overrideCacheControlHeaders();
        Common::sendHeader('Content-Description: File Transfer');
        Common::sendHeader('Content-Type: ' . $contentType);
        Common::sendHeader('Content-Disposition: attachment; filename="' . str_replace('"', '\'', basename($filename)) . '";');
        Common::sendHeader('Content-Length: ' . strlen($content));
        echo $content;
    }

Usage Example

 public function sendToBrowserDownload($filename)
 {
     ReportRenderer::sendToBrowser($filename, Sms::SMS_FILE_EXTENSION, Sms::SMS_CONTENT_TYPE, $this->rendering);
 }
All Usage Examples Of Piwik\ReportRenderer::sendToBrowser