this is my upload_form.php which is in application/view/upload_form.php and code:
<html>
<head>
<title> upload form </title>
</head>
<body>
<input type='file' name='userfile' size='20' />
<input type='submit' value='Upload' />
</form>
</body>
</html>
this is my success page of upload_success.php which in application/view/upload_success.php and it's code:
<html>
<head>
<title> success upload </title>
</head>
<body>
your file was successfully uploaded!
</body>
</html>
and this is controller page upload.php which is in application/controller/upload.php and code:
class upload extends CI_Controller
{
public function _construct()
{
parent::construct();
$this->load->helper(array('form','url'));
}
public function index()
{
$this->load->view('upload_form',array('error'=>''));
}
public function do_upload()
{
$config['upload_path'] = './uploads/';
$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('userfile'))
{
$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);
}
}
}
?>
and executes on url of browser the error is that the upload_form.php page not found. and not load that page and i don't understand that what kind of configuration at upload folder .if any kind of mistakes that i did or any way for better guidence. thank u for help.