-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpy_import_excel_v2.html
44 lines (40 loc) · 1.21 KB
/
py_import_excel_v2.html
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
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$(document).ready(function (e) {
$('#frm_upload').on('submit',(function(e) {
e.preventDefault();
var formData = new FormData(this);
console.log(formData);
$.ajax({
type:'POST',
url: $(this).attr('action'),
data:formData,
cache:false,
contentType: false,
processData: false,
success:function(data){
console.log("success");
console.log(data);
},
error: function(data){
console.log("error");
console.log(data);
}
});
}));
$("#ImageBrowse").on("change", function() {
$("#frm_upload").submit();
});
});
</script>
</head>
<body>
<form action="http://localhost:5000/import/cctl_giatri_mucnuoc" id="frm_upload" name="frm_upload">
<input type="file" id="file" name="file" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel">
<input type="submit" name="btn_submit" id="btn_submit" value="Upload">
</form>
</body>
</html>