在做web项目中,需要实现ajax做一个头像上传功能。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<form action="../upImg" method="post">
<h3>ajax实现文件上传功能</h3>
<img class="img-circle" src="../img/11.jpg" alt=""/><br/>
<input type="hidden" name="imgPath" id="imgPath"/>
<input type="file" name="file" id="upfile" /><button class