我无法在 Codeigniter 中上传图像。
它总是显示不允许您尝试上传的文件类型。
我的编码(控制器):
$this->load->helper(array('form', 'url'));
$this->load->library('upload');
$config['upload_path'] = "./public/uploadimg";
$config['allowed_types'] = "*";
$config['max_size'] = '10000';
$this->upload->initialize($config);
if ( ! $this->upload->do_upload('userfile'))
{
echo $this->upload->display_errors();
//$this->load->view('upload_form', $error);
}
else
{
echo $this->upload->data($config);
//$this->load->view('upload_success', $data);
}
看法 :
<form enctype="multipart/form-data" action="http://192.1.100.1/site/test_image/upload/" method="post">
<input type="file" name="userfile" id="userfile"/><Br>
<input type="submit" name="upload" id="upload">
</form>
问候,