Multiple Uploads

#1
[eluser]baudday[/eluser]
Alright I'm having a bit of a problem. I'm trying to upload multiple files and it's not working. I don't really understand why because I did this exact thing for a different part of the application and it worked. Here's my code:

View:
Code:
<?php foreach($panels as $panel=>$val): ?>

    <?php if($panel == 'front'): ?>
        <p>Front: &lt;?=form_upload('front')?&gt;</p>
    &lt;?php endif; ?&gt;
    
    &lt;?php if($panel == 'back'): ?&gt;
        <p>Back: &lt;?=form_upload('back')?&gt;</p>
    &lt;?php endif; ?&gt;
    
    &lt;?php if($panel == 'lsleeve'): ?&gt;
        <p>Left Sleeve: &lt;?=form_upload('lsleeve')?&gt;</p>
    &lt;?php endif; ?&gt;
    
    &lt;?php if($panel == 'rsleeve'): ?&gt;
        <p>Right Sleeve: &lt;?=form_upload('rsleeve')?&gt;</p>
    &lt;?php endif; ?&gt;
    
&lt;?php endforeach; ?&gt;

Basically I have an array from inputs earlier that tells me where on the shirt the customer wanted to print. So now based on that, I'm generating fields for each panel on the shirt they said they were going to have a design on.

Controller:
Code:
$config['upload_path'] = './designs/';
$config['allowed_types'] = '';
$config['overwrite'] = FALSE;
$config['encrypt_name'] = TRUE;
                
$this->load->library('upload', $config);
                
foreach($panels as $panel=>$val)
{
                
  if($this->upload->do_upload($panel))
  {
                    
    $designs[$panel] = $this->upload->data();
                    
  }
          
}

So here I take that same array and loop through it again only this time I'm uploading the files. For some reason it won't upload the appropriate fields. It's kind of urgent that I get this ready by tomorrow so any help is greatly appreciated.

#2
[eluser]baudday[/eluser]
Oh I should mention that it will upload fine when I have just one field. As soon as there's 2 fields or more, it won't upload anything.

#3
[eluser]baudday[/eluser]
Okay I take that back, nothing is uploading now. This is really frustrating.

#4
[eluser]baudday[/eluser]
Okay looks like it had nothing to do with the multiple uploads part at all. I had to define allowed filetypes.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.