structure_files/FileType/CommonFile.php
public function download($filename = '')
    {
        $filename = $this->formatFilename($filename);
        if ($this->content) {
            $this->printHeader();
            header("Content-Disposition: attachment; filename=\"" . $filename . "\";" );
            ob_clean();
            echo $this->content;
        } elseif ($this->path) {
            $fsize = filesize($this->path);
            $this->printHeader($fsize);
            header("Content-Disposition: attachment; filename=\"" . $filename . "\";" );
            ob_clean();
            readfile($this->path);
        }
    }
public function download($filename = '')
    {
        $filename = $this->formatFilename($filename);
        if ($this->content) {
            $this->printHeader();
            header("Content-Disposition: attachment; filename=\"" . $filename . "\";" );
            ob_clean();
            echo $this->content;
        } elseif ($this->path) {
            $fsize = filesize($this->path);
            $this->printHeader($fsize);
            header("Content-Disposition: attachment; filename=\"" . $filename . "\";" );
            ob_clean();
            readfile($this->path);
        }
    }
public function download ( $ filename = '' ) { $ filename = $ this -> formatFilename ( $ filename ) ; if ( $ this -> content ) { $ this -> printHeader ( ) ; header ( "Content-Disposition: attachment; filename=\"" . $ filename . "\";" ) ; ob_clean ( ) ; echo $ this -> content ; } elseif ( $ this -> path ) { $ fsize = filesize ( $ this -> path ) ; $ this -> printHeader ( $ fsize ) ; header ( "Content-Disposition: attachment; filename=\"" . $ filename . "\";" ) ; ob_clean ( ) ; readfile ( $ this -> path ) ; } }
Download file in web browser.

@param string $filename
@return void
Download file in web browser .