Welcome Guest, Not a member yet? Register   Sign In
Mysterious upload error, do_upload function doesn't exist?

Hi there,

I am trying to use the File Upload library to upload an image. But I get the following error when I try to load the page:

Quote:Fatal error: Call to undefined function do_upload()in /home/wyotrail/public_html/edit/igniter/application/controllers/images.php on line 134

I'm pretty sure I must be missing something simple.

The relevant code is as follows:


function _upload_image() {
    //upload file
    $config['upload_path'] = './uploads/';
    $config['allowed_types'] = 'gif|jpg|png';
    $config['max_size'] = '100';
    $config['max_width'] = '640';
    $config['max_height'] = '480';
    //load library for uploading files
    $this->load->library('upload', $config);
    if (!$this->upload>do_upload('image')) {    //this is the line causing errors
        $this->upload_error = $this->upload->display_errors();
        return false;
    return true;

<? echo form_open_multipart('images/add'); ?>
    <table border="0" cellpadding="3" cellspacing="0" align="center">
            Upload File:
            &lt;input type="file" size="20" name="image" /&gt;
        <tr><td colspan="2" align="center">
            &lt;input type="submit" name="submit" value="Submit" /&gt;
&lt;? echo form_close(); ?&gt;

The add() function of my Image controller calls the _upload_image() function above upon submitting the form.

If anyone has an idea how to resolve this, please let me know. Thanks!

Read carefully =)

// should be

I knew it was going to be something stupid. Smile Thanks a lot though!

Theme © iAndrew 2016 - Forum software by © MyBB