multiple file html -> do_upload |
[eluser]Pana_Ruplahlava[/eluser]
Hi, i want to use do_upload with this html code: Code: <form action="http://192.168.1.100/ruplahlava/a/up" method="post" accept-charset="utf-8" enctype="multipart/form-data"> ...so my $files looks like: Code: Array But when i want to use do_upload function in foreach -> Code: function _upload() { i get error Quote:Message: is_uploaded_file() expects parameter 1 to be string, array given What should i do to make it working? Thx for help :)
[eluser]noslen1[/eluser]
The parameter in $this->upload->do_upload() has to be the field name of the upload file input. Try Code: if (!$this->upload->do_upload('files')) {
[eluser]Pana_Ruplahlava[/eluser]
nope, still getting Code: Message: is_uploaded_file() expects parameter 1 to be string, array given
[eluser]Pana_Ruplahlava[/eluser]
Sooooo... After some time i figured it out so if you use Code: <input type="file" multiple="multiple" name="files[]" /> Code: $fdata = $_FILES['files']; http://verens.com/2009/12/28/multiple-fi...ing-html5/ ofcourse you have to change name of first array as you have in html and the same in do_upload!!! Hope it helped |
Welcome Guest, Not a member yet? Register Sign In |