使用CI上传图片提示 类型不允许
提示 The filetype you are attempting to upload is not allowed.function do_upload() {
//echo getcwd().'\uploads';
//exit;
$config ['upload_path'] = './uploads/';
$config ['allowed_types'] = 'gif|jpg|jpeg|png|';
$config ['encrypt_name'] = true;
$config ['max_size'] = '1000';
$config ['max_width'] = '1024';
$config ['max_height'] = '768';
$this->load->library ( 'upload', $config );
if (! $this->upload->do_upload ()) {
$error = array ('error' => $this->upload->display_errors () );
$this->load->view ( 'upload_form', $error );
} else {
$data = array ('upload_data' => $this->upload->data () );
$this->load->view ( 'upload_success', $data );
}
}
看这里 http://codeigniter.org.cn/forums/thread-442-1-1.html 修改mimes没效果.gif,jpg都不行 mime在各浏览器里得到的不一定是一样的。所以最好多试一下。。
页:
[1]