library/Garp/Controller/Helper/Download.php
protected function _setHeaders($bytes, $filename, Zend_Controller_Response_Abstract $response) {
        // fix for IE catching or PHP bug issue
        $response->setHeader('Pragma', 'public');
        // set expiration time
        $response->setHeader('Expires', '0'); 
        // browser must download file from server instead of cache
        $response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0');
    
        // force download dialog
        $response->setHeader('Content-Type', 'application/octet-stream');
    
        // use the Content-Disposition header to supply a recommended filename and
        // force the browser to display the save dialog.
        $response->setHeader(
            'Content-Disposition',
            'attachment; filename="'.basename($filename).'"'
        );

        /*
        The Content-transfer-encoding header should be binary, since the file will be read
        directly from the disk and the raw bytes passed to the downloading computer.
        The Content-length header is useful to set for downloads. The browser will be able to
        show a progress meter as a file downloads. The content-length can be determined by
        filesize function returns the size of a file.
        */
        $response->setHeader('Content-Transfer-Encoding', 'binary');
        $response->setHeader('Content-Length', strlen($bytes));
    }
protected function _setHeaders($bytes, $filename, Zend_Controller_Response_Abstract $response) {
        // fix for IE catching or PHP bug issue
        $response->setHeader('Pragma', 'public');
        // set expiration time
        $response->setHeader('Expires', '0'); 
        // browser must download file from server instead of cache
        $response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0');
    
        // force download dialog
        $response->setHeader('Content-Type', 'application/octet-stream');
    
        // use the Content-Disposition header to supply a recommended filename and
        // force the browser to display the save dialog.
        $response->setHeader(
            'Content-Disposition',
            'attachment; filename="'.basename($filename).'"'
        );

        /*
        The Content-transfer-encoding header should be binary, since the file will be read
        directly from the disk and the raw bytes passed to the downloading computer.
        The Content-length header is useful to set for downloads. The browser will be able to
        show a progress meter as a file downloads. The content-length can be determined by
        filesize function returns the size of a file.
        */
        $response->setHeader('Content-Transfer-Encoding', 'binary');
        $response->setHeader('Content-Length', strlen($bytes));
    }
protected function _setHeaders ( $ bytes , $ filename , Zend_Controller_Response_Abstract $ response ) { // fix for IE catching or PHP bug issue $ response -> setHeader ( 'Pragma' , 'public' ) ; // set expiration time $ response -> setHeader ( 'Expires' , '0' ) ; // browser must download file from server instead of cache $ response -> setHeader ( 'Cache-Control' , 'must-revalidate, post-check=0, pre-check=0' ) ; // force download dialog $ response -> setHeader ( 'Content-Type' , 'application/octet-stream' ) ; // use the Content-Disposition header to supply a recommended filename and // force the browser to display the save dialog. $ response -> setHeader ( 'Content-Disposition' , 'attachment; filename="' . basename ( $ filename ) . '"' ) ; /*
        The Content-transfer-encoding header should be binary, since the file will be read
        directly from the disk and the raw bytes passed to the downloading computer.
        The Content-length header is useful to set for downloads. The browser will be able to
        show a progress meter as a file downloads. The content-length can be determined by
        filesize function returns the size of a file.
        */ $ response -> setHeader ( 'Content-Transfer-Encoding' , 'binary' ) ; $ response -> setHeader ( 'Content-Length' , strlen ( $ bytes ) ) ; }
Set the neccessary headers for forcing the download dialog

@param String $bytes The bytes that are to be downloaded
@param String $filename The filename of the downloaded file
@param Zend_Controller_Response_Abstract $response The response object
@return Void
Set the neccessary headers for forcing the download dialog