Uploading multiple files userfile[] array?? |
[eluser]Wonder Woman[/eluser]
Hi, I am trying to upload multiple images and I have a jquery plugin set up so I can browse for multiple files and select them. The only problem I am having is accessing the file array in my controller, anyone know how I can do this? Thanks. view: Code: <input type="file" name="userfile[]" id="userfile" class="multi" />
[eluser]Ivoo[/eluser]
You should have a global array $_FILES that holds the data for the uploaded files. See http://php.net/manual/en/reserved.variables.files.php
[eluser]ludo31[/eluser]
please try to adapt your code with that : view http://pastie.org/3679320 controller http://pastie.org/3679335 view success http://pastie.org/3679342 may be you can use but you must do a foreach after Code: /* on recupere via $_FILES */
[eluser]ci_fan[/eluser]
Hi ludo31. Thanks for your great example, but I have 1 problem My view: Code: <span>Upload House</span> I want to separate the upload for House, Garden <-- it will store in different table in database I don't know how to get each of them Please help Best regards
[eluser]ci_fan[/eluser]
In my controler: Code: $config['upload_path'] = './assets/upload/'; It works, upload all the files to server, but I won't know which one belong to House, Garden Thanks for your time Best regards,
[eluser]ludo31[/eluser]
if you want to know the name of image change Code: $config['encrypt_name'] =TRUE; Code: $config['encrypt_name'] =FALSE; |
Welcome Guest, Not a member yet? Register Sign In |