public function downloadAction()
    {
        $model = $this->getModel();
        $model->applyRequest($this->getRequest());

        $fileData = $model->loadFirst();

        header('Content-Type: application/x-download');
        header('Content-Length: '.$fileData['size']);
        header('Content-Disposition: inline; filename="'.$fileData['filename'].'"');
        header('Pragma: public');

        echo $fileData['content'];
        exit();
    }
public function downloadAction()
    {
        $model = $this->getModel();
        $model->applyRequest($this->getRequest());

        $fileData = $model->loadFirst();

        header('Content-Type: application/x-download');
        header('Content-Length: '.$fileData['size']);
        header('Content-Disposition: inline; filename="'.$fileData['filename'].'"');
        header('Pragma: public');

        echo $fileData['content'];
        exit();
    }
public function downloadAction ( ) { $ model = $ this -> getModel ( ) ; $ model -> applyRequest ( $ this -> getRequest ( ) ) ; $ fileData = $ model -> loadFirst ( ) ; header ( 'Content-Type: application/x-download' ) ; header ( 'Content-Length: ' . $ fileData [ 'size' ] ) ; header ( 'Content-Disposition: inline; filename="' . $ fileData [ 'filename' ] . '"' ) ; header ( 'Pragma: public' ) ; echo $ fileData [ 'content' ] ; exit ( ) ; }
Action for downloading the file
Action for downloading the file