日期:2014-05-17 浏览次数:20471 次
<?php
if(isset($_FILES['file'])){
$upload='upload/'.$_FILES['file']['name'];
if(is_uploaded_file($_FILES['file']['tmp_name'])){
//iconv函数解决上传文件中文名乱码的问题,但是不提倡文件名是中文的,特别是unix/linux环境下
if(!move_uploaded_file($_FILES['file']['tmp_name'],iconv('UTF-8','gb2312',$upload))){
echo 'failed';
}else{
echo 'success';
}
}
else{
echo 'failed';
}
}
?>
?