Right now my image links look like this:
I need them to look like this:
My Images are stored in APP/uploads/userid/images/filename.jpg
This is my view at the moment:
<?php foreach($file as $files){?>
<?php echo $this->Html->link($files['Image']['filename'], array('controller' => 'images', 'action' => 'downloadImages', $files['Image']['filename']), array('class' => 'frame'));}?>
It works and clicking the link shows the relevant image correctly.
Controller snippet for reference:
public function downloadImages($filename) {
$download = !empty($_GET['download']);
$idUser = $this->Auth->user('idUser');
$folder_url = APP.'uploads/'.$idUser.'/'.'images'.'/'.$filename;
$this->response->file($folder_url, array('download' => $download, 'name' => $filename));
return $this->response;
}
What do I need to do to make images display as links instead of the name of the file?