aboutsummaryrefslogtreecommitdiffstats
path: root/public/js/transfer.js
blob: d3d23b3e058c8ca5e0028f8614bafa713f25f01f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* eslint-env browser */
const submitBtn = document.getElementById('submit');
const fileInput = document.getElementById('file');
const fileOutput = document.getElementById('fileoutput');

fileInput.addEventListener('change', () => {
  const reader = new FileReader();
  reader.onload = function () {
    const text = reader.result;
    fileOutput.value = text;
    submitBtn.disabled = false;
  };
  reader.readAsText(fileInput.files[0]);
})