php - codeigniter upload config -


how specify more 1 configuration in config/upload.php ?

i think it's not posible it, manual says:

setting preferences in config file

if prefer not set preferences using above method, can instead put them config file. create new file called upload.php, add $config array in file. save file in: config/upload.php , used automatically. not need use $this->upload->initialize function if save preferences in config file.

so you're adding $config array() without key auto-initialize. better make config file , load config params like:

$config['upload_1']['upload_path'] = './uploads/'; $config['upload_1']['allowed_types'] = 'gif|jpg|png'; $config['upload_1']['max_size'] = '100'; $config['upload_1']['max_width']  = '1024'; $config['upload_1']['max_height']  = '768'; 

and loading later in controller with:

$this->load->config('upload_vals', true);  $upload_vals = $this->config->item('upload_1');  $this->load->library('upload', $upload_vals); 

wish helps!


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -