I am beginner in CI 3 and I want to upload two files images. I tried google but nothing works. Thanks for all your help
HTML View
<form method="post" accept-charset="utf-8" action="Kasprof" enctype="multipart/form-data">
<div class="form-group">
Parent / Potvrdenie zákonného zástupcu
<input name="images[parent]" type="file">
</div>
<div class="form-group">
Doctor / Potvrdenie od doktora
<input name="images[doctor]" type="file">
</div>
<button type="submit" class="btn btn-default">Send / Poslať</button>
</form>
PHP Controller:
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'gif|jpg|png|pdf|jpeg';
$config['max_size'] = "4096000";
$config['max_width'] = "4096";
$config['max_height'] = "4096";
$this->upload->initialize($config);
$this->upload->do_upload($_FILES);
Error:
Message: Illegal offset type in isset or empty
Filename: libraries/Upload.php
Line Number: 377
Message: preg_match_all() expects parameter 2 to be string, array given
Filename: libraries/Upload.php
Line Number: 382