<form enctype="multipart/form-data" action="3.php" method="post">
<input type="hidden" name="max_file_size" value="30000" />
选择文件:<input type="file" name="userfile" />
<input type="submit" value="上传文件" name="buttom"/>
</form><?php
header('Content-Type:text/html;charset=utf-8');
$example=substr($_FILES["userfile"]["name"],strrpos($_FILES["userfile"]["name"],".")+1);
$mydir="upfiles/".md5(time()).".".$example;
move_uploaded_file($_FILES["userfile"]["tmp_name"],$mydir);
?>
3 回答
慕粉1417175223
TA贡献1条经验 获得超0个赞
form 标签中添加 enctype="multipart/form-data" 了吗 <form action="路径" method="传参方式" enctype="multipart/form-data"></form>
添加回答
举报
0/150
提交
取消