先报错failed to open stream: Invalid argument然后写入失败。文档编码使用UTF-8因为用英文文件试过,一切正常试过各种iconv('xxx','xxx',$str);貌似无效代码如下if(is_uploaded_file($_FILES['userfile']['tmp_name'])){
echo '临时文件已经找到';
$name = $_FILES['userfile']['name'];
$upload_path=$_SERVER['DOCUMENT_ROOT']."/upload/";
$dest_file=$upload_path.basename($_FILES['userfile']['name']);
if (function_exists("iconv"))
{
$dest_file=iconv("UTF-8","GBK",$dest_file);
}
//iconv("UTF-8","GB2312//IGNORE",$name);
//mb_convert_encoding($name, 'ANSI');
echo mb_detect_encoding($name);
move_uploaded_file($_FILES['userfile']['tmp_name'], 'uploads'.'/'."$dest_file");
}else{
echo '找不到上传的文件';
}
- 1 回答
- 0 关注
- 3056 浏览
添加回答
举报
0/150
提交
取消