CodeIgniter Forums

Full Version: $this->upload->data() problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

I want to use $pluspayment_uploads['orig_name'][$i] but i have problem becouse CI function $this->upload->data() does not recognize multiple photos. I get error like

Message: Uninitialized string offset: 0 and 1
Filename: controllers/admin.php

this line: 'title_photo' => $pluspayment_uploads['orig_name'][$i]

if($_FILES['pluspayment_title_photo']['name'][$i] != '')
$pluspayment_uploads = $this->upload->data();
$data_insert_polje = array(
     'arrangement_event_id' => $new_id ,
     'number_of' => $_POST['pluspayment_number_of'][$i] ,
     'price_eur' => $_POST['pluspayment_price_eur'][$i] ,
     'title' => $_POST['arrangement_pluspayment'][$i] ,
     'description' => $_POST['pluspayment_description'][$i] ,
     'title_photo' => $pluspayment_uploads['orig_name'][$i]
$this->db->insert('arrangement_pluspayment', $data_insert_polje);    

any idea how to fix that?

El Forum

i also get error

Quote:A PHP Error was encountered

Severity: Notice

Message: Array to string conversion

Filename: libraries/Upload.php

Line Number: 152

becouse i have the name of array

<tr><td>Fotka: &lt;input type="file" name="pluspayment_title_photo[]" /&gt;&lt;/tr>


$this->upload->do_upload('pluspayment_title_photo') can not except array.

How can i upload multiple file in array?


El Forum


El Forum

[eluser]Randy Casburn[/eluser]
Mitja -- I type "multiple file upload" in the forum search bar at the top right of this page and it returned pages and pages of helpful results. Here is a post that you may find most useful:

If not, please try that search yourself. You may find that searching the forums really does yield some great answers.