src/Rah/Backup.php
private function download()
    {
        $file = (string) gps('file');

        try {
            $backups = $this->getBackups();
        } catch (Exception $e) {
        }

        if (empty($backups) || !isset($backups[$file])) {
            $this->browser(array(gTxt('rah_backup_can_not_download'), E_ERROR));
            return;
        }

        extract($backups[$file]);

        @ini_set('zlib.output_compression', 'Off');
        @set_time_limit(0);
        @ignore_user_abort(true);

        ob_clean();
        header('Content-Description: File Download');
        header('Content-Type: application/octet-stream');
        header('Content-Disposition: attachment; filename="'.$name.'"; size="'.$size.'"');
        header('Content-Transfer-Encoding: binary');
        header('Expires: 0');
        header('Cache-Control: private');
        header('Content-Length: '.$size);
        ob_flush();
        flush();

        if ($f = fopen($path, 'rb')) {
            while(!feof($f) && connection_status() == 0) {
                echo fread($f, 1024*64);
                ob_flush();
                flush();
            }

            fclose($f);
        }

        exit;
    }
private function download()
    {
        $file = (string) gps('file');

        try {
            $backups = $this->getBackups();
        } catch (Exception $e) {
        }

        if (empty($backups) || !isset($backups[$file])) {
            $this->browser(array(gTxt('rah_backup_can_not_download'), E_ERROR));
            return;
        }

        extract($backups[$file]);

        @ini_set('zlib.output_compression', 'Off');
        @set_time_limit(0);
        @ignore_user_abort(true);

        ob_clean();
        header('Content-Description: File Download');
        header('Content-Type: application/octet-stream');
        header('Content-Disposition: attachment; filename="'.$name.'"; size="'.$size.'"');
        header('Content-Transfer-Encoding: binary');
        header('Expires: 0');
        header('Cache-Control: private');
        header('Content-Length: '.$size);
        ob_flush();
        flush();

        if ($f = fopen($path, 'rb')) {
            while(!feof($f) && connection_status() == 0) {
                echo fread($f, 1024*64);
                ob_flush();
                flush();
            }

            fclose($f);
        }

        exit;
    }
private function download ( ) { $ file = ( string ) gps ( 'file' ) ; try { $ backups = $ this -> getBackups ( ) ; } catch ( Exception $ e ) { } if ( empty ( $ backups ) || ! isset ( $ backups [ $ file ] ) ) { $ this -> browser ( array ( gTxt ( 'rah_backup_can_not_download' ) , E_ERROR ) ) ; return ; } extract ( $ backups [ $ file ] ) ; @ ini_set ( 'zlib.output_compression' , 'Off' ) ; @ set_time_limit ( 0 ) ; @ ignore_user_abort ( true ) ; ob_clean ( ) ; header ( 'Content-Description: File Download' ) ; header ( 'Content-Type: application/octet-stream' ) ; header ( 'Content-Disposition: attachment; filename="' . $ name . '"; size="' . $ size . '"' ) ; header ( 'Content-Transfer-Encoding: binary' ) ; header ( 'Expires: 0' ) ; header ( 'Cache-Control: private' ) ; header ( 'Content-Length: ' . $ size ) ; ob_flush ( ) ; flush ( ) ; if ( $ f = fopen ( $ path , 'rb' ) ) { while ( ! feof ( $ f ) && connection_status ( ) == 0 ) { echo fread ( $ f , 1024 * 64 ) ; ob_flush ( ) ; flush ( ) ; } fclose ( $ f ) ; } exit ; }
Streams backups for downloading.
Streams backups for downloading .