[eluser]adekenny[/eluser]
thanks a lot.
I've autoloaded the "upload" library and the "form" helper as your suggested but it's still not working.
The error message i'm now getting is:
Unable to find a post variable called userfile.
I even tried renaming the form file to "username" and pass it as a post variable ($_FILE['userfile']['name']) to the controller but it kept saying the same thing. I later rename it back to $data as shown in the e-book i'm using but the proble persist.
Please see my view below:
<?php
$this->load->helper('form');
$this->load->helper('url');
echo @$errors;;
echo form_open_multipart('upload/do_upload');
echo form_upload($data);
echo form_submit('mysubmit', 'Submit Post!');
echo form_close();
?>
Also see my controller code:
function do_upload()
{
if(!$this->upload->do_upload($this->userfile))
{
$errors = array('errors' => $this->upload->display_errors());
$data['menu'] = $this->my_menu;
$data['base'] = $this->base;
$data['css'] = $this->css;
$this->load->view('photo_upload_failed', $errors);
}
else
{
$data['myupload'] = array('upload_data' => $this->upload->$this->data());
$data['menu'] = $this->my_menu;
$data['base'] = $this->base;
$data['css'] = $this->css;
$this->load->view('upload_success', $data);
}
}
Thanks for all your help so far......but I still need more HELP to get this solved as i've done all i know to get the do_upload function to see the post variable called "userfile " but it's not just working.