Welcome Guest, Not a member yet? Register   Sign In
Upload and insert file data in CodeIgniter
#3

[eluser]doubleplusgood[/eluser]
@flemming

Hey, thanks for the reply. I just got a solution working using the following code;

Code:
$data = array('upload_data' => $this->upload->data());

$data['upload_data']['file_name'];
$data['upload_data']['file_type'];
$data['upload_data']['file_ext'];
$data['upload_data']['file_size'];

$newdb = array();
$newdb['name'] = $this->input->post('name');
$newdb['notes'] = $this->input->post('notes');
$newdb['file_name'] = $data['upload_data']['file_name'];
$newdb['file_type'] = $data['upload_data']['file_type'];
$newdb['file_ext'] = $data['upload_data']['file_ext'];
$newdb['file_size'] = $data['upload_data']['file_size'];
$newdb['owner'] = $this->auth->get_user();

//echo '<pre>';
//print_r($data);
//echo '</pre>';

//$_POST['owner'] = $this->auth->get_user();

$this->db->insert('files', $newdb);

Not sure whether this is the right way to do things as it does seem rather verbose. Big Grin


Messages In This Thread
Upload and insert file data in CodeIgniter - by El Forum - 10-13-2009, 06:11 AM
Upload and insert file data in CodeIgniter - by El Forum - 10-13-2009, 07:42 AM
Upload and insert file data in CodeIgniter - by El Forum - 10-13-2009, 08:00 AM



Theme © iAndrew 2016 - Forum software by © MyBB