![]() |
Multiple File Upload - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: Multiple File Upload (/showthread.php?tid=44389) |
Multiple File Upload - El Forum - 08-12-2011 [eluser]Thiago Leao[/eluser] I'm trying to send 5 images, but only sends 1. Anyone know where I'm wrong? Thanks Code: <?php Code: function go() { Multiple File Upload - El Forum - 08-14-2011 [eluser]AlexJ[/eluser] I think you are redirecting in the for loop? Multiple File Upload - El Forum - 08-14-2011 [eluser]darrentaytay[/eluser] I done a simple blog post on this for 2 images - should be easily adapted for 5: http://darrenonthe.net/2011/05/08/upload-multiple-files-with-codeigniter/ Multiple File Upload - El Forum - 08-14-2011 [eluser]phpxpert[/eluser] After uploading one image you are redirecting the user to another page by the code Code: redirect(base_url().'administracao/cad_produto/upload/'.$data['id_products'], 'refresh'); so place the redirecting command after the for loop Multiple File Upload - El Forum - 08-14-2011 [eluser]Thiago Leao[/eluser] hi friends, actually, I forgot to get the redirect loop! thank you all! Multiple File Upload - El Forum - 08-16-2011 [eluser]Thiago Leao[/eluser] Hi guys, I'm having another problem!! I'm trying to send 3 images. but it attempts to send 5, and userfile_4 undefined. I'm finding that my count is wrong!! A PHP Error was encountered Severity: Notice Message: Undefined index: userfile_4 Filename: administracao/upload.php Line Number: 17 Code: for ($i = 1; $i < count($_FILES['userfile_'.$i]); $i++) { Multiple File Upload - El Forum - 08-16-2011 [eluser]Thiago Leao[/eluser] I did it! for ($i = 0; $i < count($_FILES); $i++) |