CodeIgniter Forums

Full Version: [asking] Making Multidimensional array upload
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]fsw[/eluser]
I have a form like this:
Code:
<tbody>
    <tr>
        <td scope="col" class="title"><div class="data">Event Notification</div></td>
        <td rowspan="2" scope="col" class="title file">
        <div class="data">
            &lt;?php if (isset($error)) echo $error;?&gt;
            &lt;input type="file" name="userfile[]" size="20" class="multi" /&gt;
            <br />
        </div>
        </td>
    </tr>
    <tr>
        <td scope="col" class="title">
        <div class="data">
        Note
        <br/>
        <br/>
        <fieldset>
            <legend title="">
            &lt;textarea id="nature_of_loss" name="nature_of_loss" cols="25" rows="7" class="round-corner-4px"&gt;&lt;?php echo set_value('nature_of_loss'); ?&gt;&lt;/textarea&gt;&lt;/textarea>
            </legend>
        </legend>
    &lt;?php echo form_error('nature_of_loss'); ?&gt;
        </div>
        </td>
    </tr>
    <tr>
        <td scope="col" class="title"><div class="data">Fact Finding Survey</div></td>
        <td rowspan="2" scope="col" class="title file">
        <div class="data">
            &lt;?php if (isset($error)) echo $error;?&gt;
            &lt;input type="file" name="userfile[]" size="20" class="multi" /&gt;
            <br />
        </div>
        </td>
    </tr>
    <tr>
        <td scope="col" class="title">
        <div class="data">
        Note
        <br/>
        <br/>
        <fieldset>
            <legend title="">
            &lt;textarea id="nature_of_loss" name="nature_of_loss" cols="25" rows="7" class="round-corner-4px"&gt;&lt;?php echo set_value('nature_of_loss'); ?&gt;&lt;/textarea&gt;&lt;/textarea>
            </legend>
        </legend>
        &lt;?php echo form_error('nature_of_loss'); ?&gt;
        </div>
        </td>
    </tr>
</tbody>

I'm using http://www.mitesdesign.com/blog/open-sou...de-igniter for each of the file upload, so each one of them have multiple upload capabilities and there are 7 of them.

The question is how to make it upload multidimensonaly... thx before

El Forum

[eluser]Ben Edmunds[/eluser]
Why not use the multi file upload library in that article?

El Forum

[eluser]fsw[/eluser]
I can use the multi upload from that library, but what i want is every upload that happen have it's own unique id, so it's like:


id 1 -> have multiupload
id 2 -> have multiupload
id 3 -> have multiupload
id 4 -> have multiupload
and so on....


If i'm not mistaking, that's a multidemensional array right? and the library doesnt accept multidemensonal array, well i'll look for another way around, until someone has a good idea how to make this work, or maybe it's just me being stupid LOL. Thx for the fast reply though.

El Forum

[eluser]Ben Edmunds[/eluser]
You can just loop through the array and upload each file.

Maybe I don't understand the problem but you should simply be able to do a foreach on each upload and do one upload per file.

El Forum

[eluser]fsw[/eluser]
I use uploadify instead with tab to seperate it, fiuh.... it's done now.