views:

9

answers:

1

i cal upload images to folder if i use absolute url. but how to use absolute url?

function do_upload() { $config['upload_path'] = 'upload/'; $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()) { $error = array('error' => $this->upload->display_errors());

$this->load->view('upload_form', $error); } else { $data = array('upload_data' => $this->upload->data());

$this->load->view('upload_success', $data); } }

The above is my code for controller. i try to upload, but i can't judge in which path the folder should be located? either it should be in root or in controller or in view?

A: 

It should go in root.

KutePHP