Skip to content

Commit ff2b047

Browse files
committed
feat(web): clear input file after conversion
1 parent 247640f commit ff2b047

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

templates/index.jinja

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,20 @@
9090
<div class="error">{{ error }}</div>
9191
{% endif %}
9292

93-
<form method="POST" action="/" enctype="multipart/form-data">
94-
<input type="file" name="file" accept=".xlsx">
93+
<form method="POST" action="/" enctype="multipart/form-data" id="uploadForm">
94+
<input type="file" name="file" accept=".xlsx" id="fileInput">
9595
<br>
9696
<button type="submit">Převést a stáhnout</button>
9797
</form>
9898
</div>
9999
</div>
100+
<script>
101+
// Clear file input after form submission (download starts)
102+
document.getElementById('uploadForm').addEventListener('submit', function() {
103+
setTimeout(function() {
104+
document.getElementById('fileInput').value = '';
105+
}, 100);
106+
});
107+
</script>
100108
</body>
101109
</html>

0 commit comments

Comments
 (0)