upload.html
1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head>
<th:block th:include="include :: header"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<h2> 提醒:1.请用ip登录 不要用localhost 2.如果是linux环境,请确定apkpath配置好 3.如果上传了一个已经有的文件,上传将会失败</h2>
<form class="form-signin" method="post" enctype="multipart/form-data" id="uploadsrmFile">
<p><input type="file" name="myfile" id="myfile"/></p>
<p><input type="submit" value="上传"/></p>
</form>
</div>
<th:block th:include="include :: footer"/>
<script type="text/javascript">
var prefix = ctx + "srm/srmDetail"
$("#uploadsrmFile").validate({
submitHandler: function(form) {
// console.log($('#myfile'))
// console.log($('#myfile')[0])
// var formdata=new FormData();
// formdata.append('file',$('#myfile')[0].files[0]);
var formData = new FormData();
formData.append("myfile", document.getElementById("myfile").files[0]);
$.ajax({
url:prefix+'/upload/uploadFile',
type:'post',
contentType:false,
processData:false,
data: formData,
success:function (data) {
console.log("============="+data)
if(data.code==200){
parent.$('#uploadfile').val(data.msg);
$.modal.close();
}
}
})
}
})
</script>
</body>
</html>