public function showFile($field = null, $name = null)
    {
        $file = $this->getFilePath($field, $name);
        if (!file_exists($file) || !is_file($file)) {
            throw new NotFoundHttpException;
        }
        header('Content-Type: '. FileHelper::getMimeType($file), true);
        header('Content-Length: ' . filesize($file));
        readfile($file);
    }
public function showFile($field = null, $name = null)
    {
        $file = $this->getFilePath($field, $name);
        if (!file_exists($file) || !is_file($file)) {
            throw new NotFoundHttpException;
        }
        header('Content-Type: '. FileHelper::getMimeType($file), true);
        header('Content-Length: ' . filesize($file));
        readfile($file);
    }
public function showFile ( $ field = null , $ name = null ) { $ file = $ this -> getFilePath ( $ field , $ name ) ; if ( ! file_exists ( $ file ) || ! is_file ( $ file ) ) { throw new NotFoundHttpException ; } header ( 'Content-Type: ' . FileHelper :: getMimeType ( $ file ) , true ) ; header ( 'Content-Length: ' . filesize ( $ file ) ) ; readfile ( $ file ) ; }
Shows file to the browser.
@throws NotFoundHttpException
Shows file to the browser .