本demo只需要一个文件
```ppp
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<script>
function setfile(){
var fd = new FormData;
var pic = document.getElementsByTagName('input')[0].files[0];
fd.append('pic',pic);
var xhr = new XMLHttpRequest();
xhr.open('POST','59.php',true);
xhr.upload.onprogress = function(ev){
if(ev.lengthComputable){
var percent = 100 * ev.loaded / ev.total;
document.getElementById('bar').style.width = percent + '%';
document.getElementById('bar').innerHTML = percent + '%';
}
}
xhr.send(fd);
}
</script>
<style>
#progress{width:500px;height:30px;border:1px solid green;}
#bar{width:0%;height:100%;background:green;}
</style>
<body>
<input type="file" name="pic" onchange="setfile()">
<h1>上传进度条</h1>
<div id="progress">
<div id="bar"></div>
</div>
</body>
</html>
```