[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