I want to get pdf file from web folder in controller, but can't figure out how to do it.
I've try to get path like this
// 1 $file = __DIR__ . '/../../../../web/1.pdf'; // 2 $file = $this->get('kernel')->getRootDir().'\..\web\1.pdf'; // 3 $isSecure = $request->isSecure() ? 'https://' : 'http://'; $file = $isSecure . $request->getHost() . $this->container->get('assets.packages')->getUrl('1.pdf');
and then use file controller helper but it didn't work.
How can I get that file from public directory?