Я хочу загрузить файлы с 2 входными файлами.первый ввод просто 1 файл, а второй несколько файлов.первый ввод сохранить в «./asset/sopic», а второй сохранить в «./asset/sdpic».Вот мой код (View):
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label>Photo</label>
<table frame="box">
<tr>
<td>
<img src="<?php echo base_url()."asset/sopic/default.png"; ?>" alt="..." id="foto" class="img-responsive center-block">
<input name="foto" type="file" class="form-control border-input" placeholder="Masukkan Gambar" accept="image/*" onchange="readURL(this);">
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label><span title="To select multiple image press 'CTRL' or 'SHIFT'." style="cursor: help;">Detailed Photo <i class="far fa-question-circle"></i></span></label>
<input type="file" name="file[]" class="form-control border-input" placeholder="Masukkan Gambar" accept="image/*" multiple>
</div>
</div>
и эта модель:
$config['upload_path'] = './asset/sopic/'; //On "sopic" upload
$config['allowed_types'] = 'jfif|jpg|jpeg|png|gif'; //Pitcure Only
$config['max_size'] = '2048'; //2MB
$config['encrypt_name'] = TRUE;
//$config['file_name'] = $prna; //set new Name
$this->load->library('upload', $config); //load library upload
$id = $this->loginm->getshopid(array("nama" => $nam), array("exp" => $dat));
//Photos is detected OK
if ($this->upload->do_upload('foto')){
//Get Filename
$fnm = $this->upload->data('file_name');
chmod('./asset/sopic/'.$fnm, 0777);
//Update user table on "Photo" column where Mail as ID
$this->loginm->upvo(array('by_user' => $mail), array('kode' => $kod), array('photo' => $fnm));
$errmsg[] = array('ico' => 'ti-check', 'txt' => '<b>OK: Shop Photo </b><br><i>'.$tus.' added!</b>',
'typ' => 'success');
}else{
$errmsg[] = array('ico' => 'ti-info', 'txt' => '<b>Info: </b><br><i>'.$this->upload->display_errors().'</b>',
'typ' => 'warning');
}
if(!empty($fpi)){
$x = 0;
foreach($fpi as $gam){
$x++;
if($this->upload->do_upload($gam)){
//Get Filename
$fnm = $this->upload->data('file_name');
chmod('./asset/sdpic/'.$fnm, 0777);
//Update user table on "Photo" column where Mail as ID
$this->loginm->upvo(array('by_user' => $mail), array('kode' => $kod), array('photo' => $fnm));
}else{
$errmsg[] = array('ico' => 'ti-info', 'txt' => "<b>Info: Photo $x</b><br><i> :: ".$this->upload->display_errors().'</b>',
'typ' => 'warning');
}
}
}else{
$errmsg[] = array('ico' => 'ti-info', 'txt' => "<b>Info: </b<i>No Detail Pitcures Selected</i>",
'typ' => 'warning');
}
Но я пытаюсь загрузить всегда показывать Ошибка "Файл неподдержка».