I have the path of an image saved in my bank. I would like to put a button in my view to download this image. How to do?
I have the path of an image saved in my bank. I would like to put a button in my view to download this image. How to do?
You can use file()
method of object < strong> response for this. So:
$this->response->file(
$file['path'],
array('download' => true, 'name' => 'foo')
);