Best Way to Upload Array of Files? |
[eluser]ShoeLace1291[/eluser]
I have a form that will let a user upload one or more files. The number will always be different because they will be able to add another file input by clicking on a submit button. This will add another input field called "file[]" and will output an array of files. What's the best way to upload an array of files? PS: A feature should be added to CI that will give the ability to upload an array of files.
[eluser]Eric Barnes[/eluser]
Check out this one - https://github.com/nicdev/CodeIgniter-Mu...ile-Upload Should do what you need.
[eluser]nuwanda[/eluser]
Isn't this a client-side question? You can specify in html the number of files to upload using file[], so you may have: file[] file[] file[] for three file inputs. That will be posted as 3 elements of $_POST['file']. If you need a variable number of file inputs you'll need to have javascript add subsequent input elements on the client-side as requested. No? |
Welcome Guest, Not a member yet? Register Sign In |