public function send($filename = null, $contentType, $inline = false)
    {
        header('Pragma: public');
        header('Expires: 0');
        header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
        header('Content-Type: '.$contentType);
        header('Content-Transfer-Encoding: binary');

        // #84: Content-Length leads to "network connection was lost" on iOS
        $isIOS = preg_match('/i(phone|pad|pod)/i', $_SERVER['HTTP_USER_AGENT']);
        if (!$isIOS) {
            header('Content-Length: '.filesize($this->_fileName));
        }

        if ($filename!==null || $inline) {
            $disposition = $inline ? 'inline' : 'attachment';
            header("Content-Disposition: $disposition; filename=\"$filename\"");
        }

        readfile($this->_fileName);
    }
public function send($filename = null, $contentType, $inline = false)
    {
        header('Pragma: public');
        header('Expires: 0');
        header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
        header('Content-Type: '.$contentType);
        header('Content-Transfer-Encoding: binary');

        // #84: Content-Length leads to "network connection was lost" on iOS
        $isIOS = preg_match('/i(phone|pad|pod)/i', $_SERVER['HTTP_USER_AGENT']);
        if (!$isIOS) {
            header('Content-Length: '.filesize($this->_fileName));
        }

        if ($filename!==null || $inline) {
            $disposition = $inline ? 'inline' : 'attachment';
            header("Content-Disposition: $disposition; filename=\"$filename\"");
        }

        readfile($this->_fileName);
    }
public function send ( $ filename = null , $ contentType , $ inline = false ) { header ( 'Pragma: public' ) ; header ( 'Expires: 0' ) ; header ( 'Cache-Control: must-revalidate, post-check=0, pre-check=0' ) ; header ( 'Content-Type: ' . $ contentType ) ; header ( 'Content-Transfer-Encoding: binary' ) ; // #84: Content-Length leads to "network connection was lost" on iOS $ isIOS = preg_match ( '/i(phone|pad|pod)/i' , $ _SERVER [ 'HTTP_USER_AGENT' ] ) ; if ( ! $ isIOS ) { header ( 'Content-Length: ' . filesize ( $ this -> _fileName ) ) ; } if ( $ filename !== null || $ inline ) { $ disposition = $ inline ? 'inline' : 'attachment' ; header ( "Content-Disposition: $disposition; filename=\"$filename\"" ) ; } readfile ( $ this -> _fileName ) ; }
Send tmp file to client, either inline or as download

@param string|null $filename the filename to send. If empty, the file is streamed inline.
@param string $contentType the Content-Type header
@param bool $inline whether to force inline display of the file, even if filename is present.
Send tmp file to client either inline or as download