Welcome Guest, Not a member yet? Register   Sign In
upload image using model/view/controller
#3

[eluser]vile[/eluser]
or you can insert it after upload.


Code:
$config['upload_path'] = /path/to/file;
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size']    = '100';
$config['max_width']  = '1024';
$config['max_height']  = '768';
$this->load->library('upload', $config);


if($this->upload->do_upload())
{

$data = array(
    'name' => $_FILES['userfile'][name],
    'type' => $_FILES['userfile'][type]
);

$this->db->insert('images', $data);
}else{
  echo $this->upload->display_errors('<p>', '</p>');    
}


Messages In This Thread
upload image using model/view/controller - by El Forum - 09-19-2008, 01:26 AM
upload image using model/view/controller - by El Forum - 09-19-2008, 08:05 AM
upload image using model/view/controller - by El Forum - 09-22-2008, 01:02 AM



Theme © iAndrew 2016 - Forum software by © MyBB