public function exportFileBinaryAction()
    {
        $this->getResponse()->setType('application/octet-stream')
            ->send();
        //wyszukiwanie pliku
        if (null === $file = (new Orm\CmsFileQuery)->whereName()->equals($this->name)
            ->findFirst()) {
            throw new \Mmi\Mvc\MvcNotFoundException('File not found');
        }
        //plik zbyt duży do transferu
        if ($file->size > self::MAX_FILE_SIZE) {
            throw new \Mmi\Mvc\MvcForbiddenException('File to large');
        }
        readfile($file->getRealPath());
        exit;
    }
public function exportFileBinaryAction()
    {
        $this->getResponse()->setType('application/octet-stream')
            ->send();
        //wyszukiwanie pliku
        if (null === $file = (new Orm\CmsFileQuery)->whereName()->equals($this->name)
            ->findFirst()) {
            throw new \Mmi\Mvc\MvcNotFoundException('File not found');
        }
        //plik zbyt duży do transferu
        if ($file->size > self::MAX_FILE_SIZE) {
            throw new \Mmi\Mvc\MvcForbiddenException('File to large');
        }
        readfile($file->getRealPath());
        exit;
    }
public function exportFileBinaryAction ( ) { $ this -> getResponse ( ) -> setType ( 'application/octet-stream' ) -> send ( ) ; //wyszukiwanie pliku if ( null === $ file = ( new Orm \ CmsFileQuery ) -> whereName ( ) -> equals ( $ this -> name ) -> findFirst ( ) ) { throw new \ Mmi \ Mvc \ MvcNotFoundException ( 'File not found' ) ; } //plik zbyt duży do transferu if ( $ file -> size > self :: MAX_FILE_SIZE ) { throw new \ Mmi \ Mvc \ MvcForbiddenException ( 'File to large' ) ; } readfile ( $ file -> getRealPath ( ) ) ; exit ; }
Eksportuje binarium pliku
@return mixed
@throws \Mmi\Mvc\MvcNotFoundException
@throws \Mmi\Mvc\MvcForbiddenException
Eksportuje binarium pliku