roundcubemail/plugins/zipdownload/zipdownload.php
private function _deliver_zipfile($tmpfname, $filename)
    {
        $browser = new rcube_browser;
        $rcmail  = rcmail::get_instance();

        $rcmail->output->nocacheing_headers();

        if ($browser->ie)
            $filename = rawurlencode($filename);
        else
            $filename = addcslashes($filename, '"');

        // send download headers
        header("Content-Type: application/octet-stream");
        if ($browser->ie) {
            header("Content-Type: application/force-download");
        }

        // don't kill the connection if download takes more than 30 sec.
        @set_time_limit(0);
        header("Content-Disposition: attachment; filename=\"". $filename ."\"");
        header("Content-length: " . filesize($tmpfname));
        readfile($tmpfname);
    }
private function _deliver_zipfile($tmpfname, $filename)
    {
        $browser = new rcube_browser;
        $rcmail  = rcmail::get_instance();

        $rcmail->output->nocacheing_headers();

        if ($browser->ie)
            $filename = rawurlencode($filename);
        else
            $filename = addcslashes($filename, '"');

        // send download headers
        header("Content-Type: application/octet-stream");
        if ($browser->ie) {
            header("Content-Type: application/force-download");
        }

        // don't kill the connection if download takes more than 30 sec.
        @set_time_limit(0);
        header("Content-Disposition: attachment; filename=\"". $filename ."\"");
        header("Content-length: " . filesize($tmpfname));
        readfile($tmpfname);
    }
private function _deliver_zipfile ( $ tmpfname , $ filename ) { $ browser = new rcube_browser ; $ rcmail = rcmail :: get_instance ( ) ; $ rcmail -> output -> nocacheing_headers ( ) ; if ( $ browser -> ie ) $ filename = rawurlencode ( $ filename ) ; else $ filename = addcslashes ( $ filename , '"' ) ; // send download headers header ( "Content-Type: application/octet-stream" ) ; if ( $ browser -> ie ) { header ( "Content-Type: application/force-download" ) ; } // don't kill the connection if download takes more than 30 sec. @ set_time_limit ( 0 ) ; header ( "Content-Disposition: attachment; filename=\"" . $ filename . "\"" ) ; header ( "Content-length: " . filesize ( $ tmpfname ) ) ; readfile ( $ tmpfname ) ; }
Helper method to send the zip archive to the browser
Helper method to send the zip archive to the browser