-
Notifications
You must be signed in to change notification settings - Fork 0
/
uploadWriteUpFile.html
35 lines (35 loc) · 1.09 KB
/
uploadWriteUpFile.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>上传WriteUP文件</title>
</head>
<body>
<h1>上传WriteUP文件</h1>
<form method="POST" enctype="multipart/form-data">
{% csrf_token %}
<fieldset>
<div class="field">
<label class="label_field">选择上传的WriteUP文件(每场比赛仅可上传一次,请仔细确认无误后上传):</label>
<br/>
<input id="file" type="file" name="file" accept=".pdf," onchange="editType();" placeholder="请选择pdf格式的文件"/>
</div>
<input type="hidden" value="{{ request.GET.matchID }}" name="matchID">
<div class="field margin_0">
<button class="main_bt" formaction="/uploadwp/">提交</button>
</div>
</fieldset>
</form>
<script>
function editType() {
let file = $("#file").val();
if (!file) {
let filename = file.substr(file.lastIndexOf("."));
if (filename !== 'pdf') {
alert("请上传pdf格式的文件");
}
}
}
</script>
</body>
</html>