Welcome Guest, Not a member yet? Register   Sign In
About class upload and multiple image input
#1

[eluser]Rubiz'[/eluser]
Hi all!!

I have a form that is working ok, I'm working with fields in format of arrays just like "work[]", and "images[]" for example.

My question is about using the upload class with this kind of array field.
I'm trying to do this:
Code:
$field_name = 'userfile[' . $i . ']';                    
if ( ! $this->upload->do_upload($field_name))
...
in a for looping, but its not working...

I'll have to name "userfile1", "userfile2", "userfile3" the inputs?
Sad
#2

[eluser]dmorin[/eluser]
What does your view look like? Are you sure the field names are correct? Also, do a print_r($_POST) after the fields are posted and copy the output here for us to see.
#3

[eluser]Rubiz'[/eluser]
I solved the problem making some javascript to name de fields like userfile1, userfile2, userfile3 as long as the final user chooses images.

Than I make the upload routine, with $input = 'userfile[' . $i . ']'; never works.




Theme © iAndrew 2016 - Forum software by © MyBB