public function renderAction()
    {
        $name = $this->getRequest()->get('name');
        $hash = $this->getRequest()->get('hash');

        $response = new Response();        
        $response->setPublic();
        $response->setEtag($hash);
 
        if($response->isNotModified($this->getRequest())){
            return $response;
        }
        
        $fileManager = $this->container->get('thrace_media.filemanager');
        $content = $fileManager->getPermanentFileBlobByName($name);
        
        $response->setContent($content);
        $response->headers->set('Accept-Ranges', 'bytes');
        $response->headers->set('Content-Length', mb_strlen($content));
        $response->headers->set('Content-Type', $this->getMimeType($content));

        return $response;
    }
public function renderAction()
    {
        $name = $this->getRequest()->get('name');
        $hash = $this->getRequest()->get('hash');

        $response = new Response();        
        $response->setPublic();
        $response->setEtag($hash);
 
        if($response->isNotModified($this->getRequest())){
            return $response;
        }
        
        $fileManager = $this->container->get('thrace_media.filemanager');
        $content = $fileManager->getPermanentFileBlobByName($name);
        
        $response->setContent($content);
        $response->headers->set('Accept-Ranges', 'bytes');
        $response->headers->set('Content-Length', mb_strlen($content));
        $response->headers->set('Content-Type', $this->getMimeType($content));

        return $response;
    }
public function renderAction ( ) { $ name = $ this -> getRequest ( ) -> get ( 'name' ) ; $ hash = $ this -> getRequest ( ) -> get ( 'hash' ) ; $ response = new Response ( ) ; $ response -> setPublic ( ) ; $ response -> setEtag ( $ hash ) ; if ( $ response -> isNotModified ( $ this -> getRequest ( ) ) ) { return $ response ; } $ fileManager = $ this -> container -> get ( 'thrace_media.filemanager' ) ; $ content = $ fileManager -> getPermanentFileBlobByName ( $ name ) ; $ response -> setContent ( $ content ) ; $ response -> headers -> set ( 'Accept-Ranges' , 'bytes' ) ; $ response -> headers -> set ( 'Content-Length' , mb_strlen ( $ content ) ) ; $ response -> headers -> set ( 'Content-Type' , $ this -> getMimeType ( $ content ) ) ; return $ response ; }
Renders permanent file

@return Response
Renders permanent file