Welcome Guest, Not a member yet? Register   Sign In
Upload Error
#1

[eluser]E303[/eluser]
I have been trying to work this out for some time. When I go to upload a file I get this error:

A PHP Error was encountered

Severity: Warning

Message: Illegal offset type in isset or empty

Filename: libraries/Upload.php

Line Number: 138

The Controller:

Code:
function For_Sale_add()
    {
        $this->load->model('admin/Admin_Model');
        $this->load->model('Admin_Model');
        
        // File Upload
        $config['upload_path']        = './images/forsale/';
        $config['allowed_types']    = 'gif|jpg|png';
        $config['max_size']            = '2000';
        $config['max_width']        = '300';
        $config['max-height']        = '300';
        
        $this->load->library('upload');
        $this->upload->initialize($config);
        
        $forsaleimage = $this->upload->data();
        
        $this->upload->do_upload($forsaleimage);
        $this->Admin_Model->ForSale_add();

        $data['query'] = $this->Admin_Model->Flakes_navigation();

        $this->load->view('admin/main_admin_view', $data);

        

    }

The Model:

Code:
function ForSale_add()
    {
        $file = $this->upload->data();
        $data = array(
                        'title'        => $_POST['title'],
                        'body'        => $_POST['body'],
                        'image'        => $file['file_name']
                    );
        $this->db->insert('for_sale', $data);            
        
    }

The Form
Code:
<?=form_open_multipart('main_admin/For_Sale_add');?>
            
            <br />
            <fieldset>
            <label>Item Title:</label>
            &lt;input type="text" name="title" /&gt;
            <p>
            <label>Description:</label><br />
            &lt;textarea name="body" id="ajaxfilemanager" cols="70" rows="20"&gt;&lt;/textarea&gt;
            </p>
            <label>Image:</label>
            &lt;input type="file" name="userfile" /&gt;<br />
            <em>Max size: 300 x 300. Max file size: 2000kb</em>
            </fieldset>
            
            <br />
                &lt;input type="submit" value="Save" class="flake_submit"/&gt;

            &lt;?=form_close();?&gt;

Any ideas why?


Messages In This Thread
Upload Error - by El Forum - 10-04-2007, 12:33 AM
Upload Error - by El Forum - 10-04-2007, 08:30 AM
Upload Error - by El Forum - 10-04-2007, 08:44 AM
Upload Error - by El Forum - 10-04-2007, 09:13 AM
Upload Error - by El Forum - 10-04-2007, 08:08 PM
Upload Error - by El Forum - 10-06-2007, 07:23 AM
Upload Error - by El Forum - 10-09-2007, 07:33 PM



Theme © iAndrew 2016 - Forum software by © MyBB