I am trying to render images/pdfs that exist outside of my webroot. So this is what I'm doing in my controller to Send the File - as described here. But I'm getting a Fatal Error. Any ideas why and how to fix this? I'm running CakePHP 2.4.5.
$this->autoRender = false;
$path = '/path/to/valid/file.pdf';
$this->response->file($path);
return $this->response;
Fatal error: Call to undefined method Folder::slashTerm()
Stack trace:
- {main}() /Path/To/My/htdocs/mysite/app/webroot/index.php:0
- Dispatcher->dispatch() /Path/To/My/htdocs/mysite/app/webroot/index.php:96
- Dispatcher->_invoke() /Path/To/My/htdocs/mysite/lib/Cake/Routing/Dispatcher.php:160
- Controller->invokeAction() /Path/To/My/htdocs/mysite/lib/Cake/Routing/Dispatcher.php:185
- ReflectionMethod->invokeArgs() /Path/To/My/htdocs/mysite/lib/Cake/Controller/Controller.php:490
- PagesController->load_media() /Path/To/My/htdocs/mysite/lib/Cake/Controller/Controller.php:490
- CakeResponse->file() /Path/To/My/htdocs/mysite/app/Controller/PagesController.php:227
- File->__construct() /Path/To/My/htdocs/mysite/lib/Cake/Network/CakeResponse.php:1265
- File->pwd() /Path/To/My/htdocs/mysite/lib/Cake/Utility/File.php:91