Welcome Guest, Not a member yet? Register   Sign In
$this->upload->data() problem
#1

[eluser]Mitja[/eluser]
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]


Code:
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?
#2

[eluser]Mitja[/eluser]
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>

and

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

How can i upload multiple file in array?

PLEASE
#3

[eluser]Mitja[/eluser]
ANYONE PLEASE
#4

[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:

http://ellislab.com/forums/viewthread/80610/

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

Randy




Theme © iAndrew 2016 - Forum software by © MyBB