[eluser]dallen33[/eluser]
Code:
function download()
{
if (!$this->dx_auth->is_logged_in()):
return FALSE;
else:
$query = $this->db->get_where('attachments', array('id' => $this->uri->segment(3)));
$row = $query->row();
$data = file_get_contents($this->config->item('attachment_dir', 'booking').$row->attach_id.'/'.$row->name);
$name = $row->name;
force_download($name, $data);
endif;
}
Pretty basic code to force_download a file. Downloads every file, but if there's no extension, I just get a blank screen. Any ideas why?