views:

341

answers:

2

Here's the lowdown. PHP, Codeigniter, LAMP.

I've created a fixeee for you all to see my code. http://fixee.org/paste/s8jc04t/

Whenever I have mulitple file uploads (ex. fileupload1, fileupload2, fileupload3, etc.) and I tried to get the upload data from each one correctly, I seem to duplicate the first file data that was uploaded. Can someone help, the fixee explains everything.

+1  A: 

Perhaps you should re-initialize the library. load the config again and initialize the library:

$config['var'] = 'value';
$this->load->library('upload', $config);
Thorpe Obazee
I'll try that. Give me a sec
lucha libre
I tried that. It didn't work. Any other ideas?
lucha libre
The idea is to clear the variables in the upload class. Try clearing them by initialization and you'll be ok.
Thorpe Obazee
+2  A: 

put this line before each upload statement.


$this->upload->initialize($config);

that code will reset all config options to the default and then use your configs for the next file without reloading the library over and over.

Tom Schlick
You misspelled it, but you're right. It's $this->upload->initialize($config);
lucha libre
Thanks! Fixed the typo now... to many damn i's in that word
Tom Schlick