65 lines
2.1 KiB
HTML
65 lines
2.1 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Title</title>
|
|
<style>
|
|
/* button {
|
|
padding: 10px 15px;
|
|
background-color: #4CAF50;
|
|
color: white;
|
|
border: none;
|
|
border-radius: 5px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.selectBtn {
|
|
cursor: pointer;
|
|
padding: 10px 15px;
|
|
} */
|
|
|
|
.custom-file-upload {
|
|
border: 1px solid #ccc;
|
|
display: inline-block;
|
|
padding: 6px 12px;
|
|
cursor: pointer;
|
|
background-color: #f8f8f8;
|
|
margin: 10px;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<form action="/video" enctype='multipart/form-data' method='POST' class="form1">
|
|
<label for="file-upload" class="custom-file-upload">
|
|
上传文件
|
|
</label>
|
|
<input id="file-upload" type="file" name="file" style="display:none;">
|
|
<input type="submit" value="开始预测">
|
|
</form>
|
|
<script>
|
|
document.querySelector('.custom-file-upload').addEventListener('click', function() {
|
|
document.getElementById('file-upload').click();
|
|
});
|
|
</script>
|
|
<!-- <span class="selectBtn" onclick="document.getElementById('file-input').click();">选择文件</span>
|
|
<input type="file" id="file-input" style="display: none;" onchange="updateFileName()">
|
|
<span id="file-name" style="display: none;">未选择文件</span> -->
|
|
<!-- <script>
|
|
function updateFileName() {
|
|
var input = document.getElementById('file-input');
|
|
var fileNameSpan = document.getElementById('file-name');
|
|
if (input.files.length > 0) {
|
|
var fileName = input.files[0].name;
|
|
fileNameSpan.textContent = fileName;
|
|
fileNameSpan.style.display = 'inline'; // 显示文件名
|
|
} else {
|
|
fileNameSpan.textContent = '未选择文件';
|
|
fileNameSpan.style.display = 'none'; // 隐藏元素
|
|
}
|
|
}
|
|
</script> -->
|
|
</body>
|
|
|
|
</html> |