This assumes you have an Images table.
Configure the file upload as follows:
$config['upload_path'] = './images/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '1000000';
$config['overwrite'] = TRUE;
$config['remove_spaces'] = TRUE;
$config['encrypt_name'] = FALSE;
$this->load->library('upload', $config);
Then on successful upload insert the file information into the database.
$insert_data = array(
'id_fk' => $this->input->post('page_id'),
'imgfilename' => $upload_info['file_name'],
'imgfilepath' => $upload_info['file_path']
);
$this->db->insert('images', $insert_data);
$upload info is retrived from the file_uploader class on successful upload using the following:
$upload_info = $this->upload->data();
If you want to see exactly what is returned:
echo var_dump($upload_info);
DRL
2010-07-14 21:52:08