时间:2021-07-01 10:21:17 帮助过:21人阅读
<form enctyoe="multipart/form-data" method="post" name="upload">
<input name="upfile" name="name">
</form>
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 "文件类型不允许";
}
}