CodeIgniter文件上传类上传中文名文件出错

由于upload.php中的写文件是通过copy和move_uploaded_file来实现的,因此当中文名作为参数传递到copy函数中时,

需要将gb2312编码的中文转换为UTF-8编码形式:$config['file_name'] = iconv("UTF-8","gb2312", $_FILES['userfile']['name'])

userfile是页面上传输入框的name <input type="file" name="userfile"/>

posted @ 2013-05-15 16:54  yanqing07  阅读(452)  评论(0编辑  收藏  举报