我是CI 3的初學者,我想上傳兩個文件圖像。我試過谷歌,但沒有任何作品。 感謝您的幫助CodeIgniter 3 - 多文件上傳
HTML查看
<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控制器:
$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);
錯誤:
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
任何錯誤輸出? – Tool
@Tool我忘了對不起。 –