时间:2021-07-01 10:21:17 帮助过:3人阅读
if(is_uploaded_file($_FILES['myFile']['tmp_name'])){
$upfile = $_FILES['upload'];
$name = $upfile['name'];
$type = $upfile['type'];
$size = $upfile['size'];
$tmp_name = $upfile['tmp_name'];
$error = $upfile['error'];
switch($type){
case 'image/pjpeg' : $ok=1;
break
}
if($ok){
move_uploaded_file($tmp_name,'up/'.$name);
}else{
echo "文件类型不允许";
}
}
http://www.bkjia.com/PHPjc/323464.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/323464.htmlTechArticle//表单上传只能使用multipart/form-data编码格式 $_FILES系统函数; $_FILES['myFile']['name']文件名称 $_FILES['myFile']['type']文件的类型,服务端进行限制...