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);
        }
    }
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);
        }
    }
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 ) ; } }
Force download current page

@param string $name
@param int    $contentLength
@return void
Force download current page