Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Weird CodeIgniter Upload Problem

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.

like image 320
willbeeler Avatar asked Dec 22 '22 06:12

willbeeler


2 Answers

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.

like image 61
Tom Schlick Avatar answered Dec 29 '22 12:12

Tom Schlick


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

$config['var'] = 'value';
$this->load->library('upload', $config);
like image 44
Teej Avatar answered Dec 29 '22 11:12

Teej