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

[eluser]E303[/eluser]
I can't seem to get the File Upload to work..

This is my model
Code:
function exhibitionsAddDB()
    {
        
        //insert into db
        $picture = $_FILES['userfile'];
        $url = url_title($_POST['title']);
        
        $config['upload_path'] = './uploads/';
        $config['allowed_types'] = 'gif|jpg|png';
        $this->upload->initialize($config);
        
        $file = $this->upload->do_upload($picture);
        $file_data = array('upload_data' => $this->upload->data());
        #$startDate = human_to_unix($_POST['date']);
        #$endDate = human_to_unix($_POST['enddate']);
        $data = array(
                        'title'            => $_POST['title'],
                        'description'    => $_POST['body'],
                        'date'            => $_POST['date'],
                        'endDate'        => $_POST['enddate'],
                        'artistId'        => $_POST['artist'],                
                        'url'            => $url,
                        'picture'        => $file_data['full_name'],     #this is line 224 I have also had this as $upload_data as well with no luck
                    );
        $this->db->insert('exhibitions', $data);            
    }

The error I get is
Quote:A PHP Error was encountered

Severity: Warning

Message: Illegal offset type in isset or empty

Filename: libraries/Upload.php

Line Number: 138

Then

Quote:A PHP Error was encountered

Severity: Notice

Message: Undefined index: full_name

Filename: admin/admin_model.php

Line Number: 224


Messages In This Thread
File Upload class - by El Forum - 06-17-2008, 11:52 PM
File Upload class - by El Forum - 06-18-2008, 05:02 AM
File Upload class - by El Forum - 06-18-2008, 11:39 PM
File Upload class - by El Forum - 06-19-2008, 03:48 AM
File Upload class - by El Forum - 06-19-2008, 09:11 PM
File Upload class - by El Forum - 06-24-2008, 01:23 AM
File Upload class - by El Forum - 06-24-2008, 06:03 AM
File Upload class - by El Forum - 06-24-2008, 08:09 PM



Theme © iAndrew 2016 - Forum software by © MyBB