I have a controller that in nutshell is as follows:
public function download($id) {
$data = array();
force_download($data['brochure']->location, $data['brochure']->name);
$this->renderPage('site/download', $data); // simple method basically same as load->view
}
I want the page view and then after a second to force download the file – the current function downloads the file but not the view, can anyone suggest how to get around this?
Remove the line the following line from download function
Write another function
Now in the download view add the following javascript/jquery script: