public static function download($name = null, $contentLength = 0)
    {
        if ($name) {
            $name = '; filename="' . strtr($name, '"', '-') . '"';
        } else {
            $name = '';
        }

        self::putHeader('Content-Transfer-Encoding', 'Binary');
        self::putHeader('Content-Disposition', 'attachment' . $name);

        if ($contentLength > 0) {
            self::putHeader('Content-Length', $contentLength);
        }
    }