diff options
Diffstat (limited to 'src/internal-server/public/js')
-rw-r--r-- | src/internal-server/public/js/transfer.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/internal-server/public/js/transfer.js b/src/internal-server/public/js/transfer.js new file mode 100644 index 000000000..8382bba02 --- /dev/null +++ b/src/internal-server/public/js/transfer.js | |||
@@ -0,0 +1,13 @@ | |||
1 | const submitBtn = document.getElementById('submit'); | ||
2 | const fileInput = document.getElementById('file'); | ||
3 | const fileOutput = document.getElementById('fileoutput'); | ||
4 | |||
5 | fileInput.addEventListener('change', () => { | ||
6 | const reader = new FileReader(); | ||
7 | reader.onload = () => { | ||
8 | const text = reader.result; | ||
9 | fileOutput.value = text; | ||
10 | submitBtn.disabled = false; | ||
11 | }; | ||
12 | reader.readAsText(fileInput.files[0]); | ||
13 | }); | ||