CodeIgniter - Returning multiple file upload details

Posted by Chris on Stack Overflow See other posts from Stack Overflow or by Chris
Published on 2010-12-12T19:58:32Z Indexed on 2011/01/07 12:53 UTC
Read the original article Hit count: 150

Filed under:

Hey All,

Im using the codeigniter upload library to upload multiple files, which works fine ... What im having problems with is returning the information about the files.

Im using the following code to print the results for testing

echo '<pre>'; print_r($this->upload->data()); echo '</pre>';

A cut down version of the results are as follows

Array
(
[file_name] => Array
    (
        [0] => filename1.gif
        [1] => filename2.jpg
    )
)

The way my view is setup, is that i use jquery to insert multiple dynamic file input fields so the amount of files can be 1, it can be 50 and so on.

Im wondering how i would loop through that array to send each filename to the database

© Stack Overflow or respective owner

Related posts about codeigniter