前端网页上传文件,服务器接收并存放在指定位置,同时更新文件名防止文件名冲突。
前端HTML:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
用户注册
<br />
<form action="uploadFile" method="post" enctype="multipart/form-data">
学号:<input type="text" name="xh" id="xh" />
照片:<input type="file" name="zp" id="zp">
<input type="submit" value="提交"<