public function getFile($path, $contentType) {
        if (is_file($path)) {
            $response = new Response(file_get_contents($path));
            $response->headers->set('Content-Type', $contentType);
            $response->setCharset('UTF-8');
            return $response;
        }

        return new Response('', 404);
    }
public function getFile($path, $contentType) {
        if (is_file($path)) {
            $response = new Response(file_get_contents($path));
            $response->headers->set('Content-Type', $contentType);
            $response->setCharset('UTF-8');
            return $response;
        }

        return new Response('', 404);
    }
public function getFile ( $ path , $ contentType ) { if ( is_file ( $ path ) ) { $ response = new Response ( file_get_contents ( $ path ) ) ; $ response -> headers -> set ( 'Content-Type' , $ contentType ) ; $ response -> setCharset ( 'UTF-8' ) ; return $ response ; } return new Response ( '' , 404 ) ; }
Get a public file

@param string Path to file
@param string Content-type
@return Response
Get a public file