![]() |
Upload multiple files - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11) +--- Thread: Upload multiple files (/showthread.php?tid=70052) |
Upload multiple files - Elias - 02-13-2018 Hi, I want to do upload multiple files and I can do this in cycle. But first I looked source code of Upload library and found the part of the library code. And I can't understand this code. What does this code? P.S: If my file field in form has name user[photo] and in do_upload() I passing user while file not selected (empty form submitted) that I get a PHP error: Code: Severity: Warning
RE: Upload multiple files - InsiteFX - 02-14-2018 Google is your friend Search... CodeIgniter Multi-Upload RE: Upload multiple files - Narf - 02-14-2018 (02-13-2018, 06:09 AM)Elias Wrote: Hi, It handles array-notation field names, as the comment line there says. (02-13-2018, 06:09 AM)Elias Wrote: P.S: If my file field in form has name user[photo] and in do_upload() I passing user while file not selected (empty form submitted) that I get a PHP error: Why are you passing 'user' if the field is 'user[photo]'? Why would you ever expect that to work? (02-13-2018, 06:09 AM)Elias Wrote: 1. You can't, and you shouldn't - that's what loops are made for. 2. Pass 'user[photo]' instead of 'user' ... 3. If you're referring to the error mentioned above - already answered; if not, then I don't know what you're talking about. 4. It allows you to write 'user[photo]'. RE: Upload multiple files - Elias - 02-21-2018 (02-14-2018, 11:18 AM)Narf Wrote: 2. Pass 'user[photo]' instead of 'user' ... Ok, in my controller I do this: PHP Code: $uploaded = []; Code: <?= form_open_multipart('uploader') ?> |