aboutsummaryrefslogtreecommitdiff
path: root/app/static/file.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/static/file.js')
-rw-r--r--app/static/file.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/static/file.js b/app/static/file.js
new file mode 100644
index 0000000..403ddf6
--- /dev/null
+++ b/app/static/file.js
@@ -0,0 +1,11 @@
+window.onload = function() {
+ const fileInput = document.querySelector("#file-js input[type=file]");
+ if (fileInput !== null) {
+ fileInput.onchange = () => {
+ if (fileInput.files.length > 0) {
+ const fileName = document.querySelector("#file-js .file-name");
+ fileName.textContent = fileInput.files[0].name;
+ }
+ }
+ };
+} \ No newline at end of file