[eluser]adekenny[/eluser]
Thanks for all your help.....
i've amended it as you advised but the same error message is appearing.
Unable to find a post variable called userfile.
Do i need to change something in my controller or upload library?
class Upload extends Controller
{
var $base;
var $css;
var $my_menu;
var $userfile;
function Upload()
{
parent::Controller();
$this->base = $this->config->item('base_url');
$this->css = $this->config->item('css');
$this->load->library('menu');
$this->my_menu = $this->menu->show_menu();
$this->load->library('upload');
$this->load->library('session');
$this->load->helper('form');
$this->load->helper('url');
}
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);
}
}
}