public function download_file($name)
{
//$name is the encoded filename, passed by the view
$this->load->helper('download');
$path = './uploads/docs/' . urldecode($name);
if (file_exists($path)) {
force_download($path,NULL);
}
else {
show_error('File not found!');
die();
}
}