I have a folder outside of the webfoot and I am using the $this->response->file($path); to display the images inside.
My controller code works fine when I just pass in the file name. But I need to pass it in as a part URL. This is where it breaks. I have tried to use urldecode this still sees it as a url.
<?php echo ('<img src="books/sendFile/'.rawurlencode("38/backgrounds/orchard-left.png").'" width="100%" alt="aswq" />') ?>
It is outputted as books/sendFile/38%2Fbackgrounds%2Forchard-left.png but the browser still sees it as books/sendFile/38/backgrounds/orchard-left.png
my controller
public function sendFile($file) {
$file = rawurldecode($file);
$path = ROOT.DS.'bookUploads'.DS.'Users'.DS.'ingemit/Books/'.$file;
$this->response->file($path);
return $this->response;
}